summaryrefslogtreecommitdiff
path: root/contrib/sepgsql/database.c
diff options
context:
space:
mode:
authorRobert Haas2013-03-27 12:10:14 +0000
committerRobert Haas2013-03-27 12:14:19 +0000
commit1cea9bbb21e9e90dc7085ce605d9160e7161fa58 (patch)
tree509f427c60f54bf16b8b419ab80833341e8abfab /contrib/sepgsql/database.c
parentbc5334d8679c428a709d150666b288171795bd76 (diff)
sepgsql: Support for new post-ALTER access hook.
KaiGai Kohei
Diffstat (limited to 'contrib/sepgsql/database.c')
-rw-r--r--contrib/sepgsql/database.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/contrib/sepgsql/database.c b/contrib/sepgsql/database.c
index 975c1d47958..64d37a3ca99 100644
--- a/contrib/sepgsql/database.c
+++ b/contrib/sepgsql/database.c
@@ -149,6 +149,33 @@ sepgsql_database_drop(Oid databaseId)
}
/*
+ * sepgsql_database_post_alter
+ *
+ * It checks privileges to alter the supplied database
+ */
+void
+sepgsql_database_setattr(Oid databaseId)
+{
+ ObjectAddress object;
+ char *audit_name;
+
+ /*
+ * check db_database:{setattr} permission
+ */
+ object.classId = DatabaseRelationId;
+ object.objectId = databaseId;
+ object.objectSubId = 0;
+ audit_name = getObjectDescription(&object);
+
+ sepgsql_avc_check_perms(&object,
+ SEPG_CLASS_DB_DATABASE,
+ SEPG_DB_DATABASE__SETATTR,
+ audit_name,
+ true);
+ pfree(audit_name);
+}
+
+/*
* sepgsql_database_relabel
*
* It checks privileges to relabel the supplied database with the `seclabel'