* sepgsql_proc_relabel * * It checks privileges to relabel the supplied function * by the `seclabel'. */
| 195 | * by the `seclabel'. |
| 196 | */ |
| 197 | void |
| 198 | sepgsql_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 |
no test coverage detected