MCPcopy Create free account
hub / github.com/apache/cloudberry / sepgsql_proc_drop

Function sepgsql_proc_drop

contrib/sepgsql/proc.c:154–189  ·  view source on GitHub ↗

* sepgsql_proc_drop * * It checks privileges to drop the supplied function. */

Source from the content-addressed store, hash-verified

152 * It checks privileges to drop the supplied function.
153 */
154void
155sepgsql_proc_drop(Oid functionId)
156{
157 ObjectAddress object;
158 char *audit_name;
159
160 /*
161 * check db_schema:{remove_name} permission
162 */
163 object.classId = NamespaceRelationId;
164 object.objectId = get_func_namespace(functionId);
165 object.objectSubId = 0;
166 audit_name = getObjectIdentity(&object, false);
167
168 sepgsql_avc_check_perms(&object,
169 SEPG_CLASS_DB_SCHEMA,
170 SEPG_DB_SCHEMA__REMOVE_NAME,
171 audit_name,
172 true);
173 pfree(audit_name);
174
175 /*
176 * check db_procedure:{drop} permission
177 */
178 object.classId = ProcedureRelationId;
179 object.objectId = functionId;
180 object.objectSubId = 0;
181 audit_name = getObjectIdentity(&object, false);
182
183 sepgsql_avc_check_perms(&object,
184 SEPG_CLASS_DB_PROCEDURE,
185 SEPG_DB_PROCEDURE__DROP,
186 audit_name,
187 true);
188 pfree(audit_name);
189}
190
191/*
192 * sepgsql_proc_relabel

Callers 1

sepgsql_object_accessFunction · 0.85

Calls 4

get_func_namespaceFunction · 0.85
getObjectIdentityFunction · 0.85
sepgsql_avc_check_permsFunction · 0.85
pfreeFunction · 0.50

Tested by

no test coverage detected