* sepgsql_avc_trusted_proc * * If the supplied function OID is configured as a trusted procedure, this * function will return a security label to be used during the execution of * that function. Otherwise, it returns NULL. */
| 441 | * that function. Otherwise, it returns NULL. |
| 442 | */ |
| 443 | char * |
| 444 | sepgsql_avc_trusted_proc(Oid functionId) |
| 445 | { |
| 446 | char *scontext = sepgsql_get_client_label(); |
| 447 | char *tcontext; |
| 448 | ObjectAddress tobject; |
| 449 | avc_cache *cache; |
| 450 | |
| 451 | tobject.classId = ProcedureRelationId; |
| 452 | tobject.objectId = functionId; |
| 453 | tobject.objectSubId = 0; |
| 454 | tcontext = GetSecurityLabel(&tobject, SEPGSQL_LABEL_TAG); |
| 455 | |
| 456 | sepgsql_avc_check_valid(); |
| 457 | do |
| 458 | { |
| 459 | if (tcontext) |
| 460 | cache = sepgsql_avc_lookup(scontext, tcontext, |
| 461 | SEPG_CLASS_DB_PROCEDURE); |
| 462 | else |
| 463 | cache = sepgsql_avc_lookup(scontext, sepgsql_avc_unlabeled(), |
| 464 | SEPG_CLASS_DB_PROCEDURE); |
| 465 | } while (!sepgsql_avc_check_valid()); |
| 466 | |
| 467 | return cache->ncontext; |
| 468 | } |
| 469 | |
| 470 | /* |
| 471 | * sepgsql_avc_exit |
no test coverage detected