Skip to content

Commit e914a14

Browse files
committed
sepgsql DROP support.
KaiGai Kohei
1 parent 07d1edb commit e914a14

File tree

11 files changed

+481
-86
lines changed

11 files changed

+481
-86
lines changed

contrib/sepgsql/database.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,33 @@ sepgsql_database_post_create(Oid databaseId, const char *dtemplate)
118118
pfree(tcontext);
119119
}
120120

121+
/*
122+
* sepgsql_database_drop
123+
*
124+
* It checks privileges to drop the supplied database
125+
*/
126+
void
127+
sepgsql_database_drop(Oid databaseId)
128+
{
129+
ObjectAddress object;
130+
char *audit_name;
131+
132+
/*
133+
* check db_database:{drop} permission
134+
*/
135+
object.classId = DatabaseRelationId;
136+
object.objectId = databaseId;
137+
object.objectSubId = 0;
138+
audit_name = getObjectDescription(&object);
139+
140+
sepgsql_avc_check_perms(&object,
141+
SEPG_CLASS_DB_DATABASE,
142+
SEPG_DB_DATABASE__DROP,
143+
audit_name,
144+
true);
145+
pfree(audit_name);
146+
}
147+
121148
/*
122149
* sepgsql_database_relabel
123150
*

contrib/sepgsql/expected/create.out

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy