mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
sepgsql DROP support.
KaiGai Kohei
This commit is contained in:
@ -118,6 +118,33 @@ sepgsql_database_post_create(Oid databaseId, const char *dtemplate)
|
||||
pfree(tcontext);
|
||||
}
|
||||
|
||||
/*
|
||||
* sepgsql_database_drop
|
||||
*
|
||||
* It checks privileges to drop the supplied database
|
||||
*/
|
||||
void
|
||||
sepgsql_database_drop(Oid databaseId)
|
||||
{
|
||||
ObjectAddress object;
|
||||
char *audit_name;
|
||||
|
||||
/*
|
||||
* check db_database:{drop} 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__DROP,
|
||||
audit_name,
|
||||
true);
|
||||
pfree(audit_name);
|
||||
}
|
||||
|
||||
/*
|
||||
* sepgsql_database_relabel
|
||||
*
|
||||
|
Reference in New Issue
Block a user