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

Function sepgsql_proc_relabel

contrib/sepgsql/proc.c:197–227  ·  view source on GitHub ↗

* sepgsql_proc_relabel * * It checks privileges to relabel the supplied function * by the `seclabel'. */

Source from the content-addressed store, hash-verified

195 * by the `seclabel'.
196 */
197void
198sepgsql_proc_relabel(Oid functionId, const char *seclabel)
199{
200 ObjectAddress object;
201 char *audit_name;
202
203 object.classId = ProcedureRelationId;
204 object.objectId = functionId;
205 object.objectSubId = 0;
206 audit_name = getObjectIdentity(&object, false);
207
208 /*
209 * check db_procedure:{setattr relabelfrom} permission
210 */
211 sepgsql_avc_check_perms(&object,
212 SEPG_CLASS_DB_PROCEDURE,
213 SEPG_DB_PROCEDURE__SETATTR |
214 SEPG_DB_PROCEDURE__RELABELFROM,
215 audit_name,
216 true);
217
218 /*
219 * check db_procedure:{relabelto} permission
220 */
221 sepgsql_avc_check_perms_label(seclabel,
222 SEPG_CLASS_DB_PROCEDURE,
223 SEPG_DB_PROCEDURE__RELABELTO,
224 audit_name,
225 true);
226 pfree(audit_name);
227}
228
229/*
230 * sepgsql_proc_setattr

Callers 1

sepgsql_object_relabelFunction · 0.85

Calls 4

getObjectIdentityFunction · 0.85
sepgsql_avc_check_permsFunction · 0.85
pfreeFunction · 0.50

Tested by

no test coverage detected