PostgreSQL Source Code git master
|
#include "catalog/objectaddress.h"
Go to the source code of this file.
Typedefs | |
typedef void(* | check_object_relabel_type) (const ObjectAddress *object, const char *seclabel) |
Functions | |
char * | GetSecurityLabel (const ObjectAddress *object, const char *provider) |
void | SetSecurityLabel (const ObjectAddress *object, const char *provider, const char *label) |
void | DeleteSecurityLabel (const ObjectAddress *object) |
void | DeleteSharedSecurityLabel (Oid objectId, Oid classId) |
ObjectAddress | ExecSecLabelStmt (SecLabelStmt *stmt) |
void | register_label_provider (const char *provider_name, check_object_relabel_type hook) |
typedef void(* check_object_relabel_type) (const ObjectAddress *object, const char *seclabel) |
Definition at line 29 of file seclabel.h.
void DeleteSecurityLabel | ( | const ObjectAddress * | object | ) |
Definition at line 523 of file seclabel.c.
References Assert, BTEqualStrategyNumber, CatalogTupleDelete(), ObjectAddress::classId, DeleteSharedSecurityLabel(), HeapTupleIsValid, Int32GetDatum(), IsSharedRelation(), ObjectAddress::objectId, ObjectIdGetDatum(), ObjectAddress::objectSubId, RowExclusiveLock, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), HeapTupleData::t_self, table_close(), and table_open().
Referenced by deleteOneObject().
Definition at line 491 of file seclabel.c.
References BTEqualStrategyNumber, CatalogTupleDelete(), HeapTupleIsValid, ObjectIdGetDatum(), RowExclusiveLock, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), HeapTupleData::t_self, table_close(), and table_open().
Referenced by DeleteSecurityLabel(), dropdb(), DropRole(), and DropTableSpace().
ObjectAddress ExecSecLabelStmt | ( | SecLabelStmt * | stmt | ) |
Definition at line 115 of file seclabel.c.
References check_object_ownership(), ereport, errcode(), errdetail_relkind_not_supported(), errmsg(), ERROR, get_object_address(), GetUserId(), label_provider_list, lfirst, linitial, list_length(), NIL, NoLock, OBJECT_COLUMN, provider, LabelProvider::provider_name, RelationData::rd_rel, relation_close(), RelationGetRelationName, SecLabelSupportsObjectType(), SetSecurityLabel(), ShareUpdateExclusiveLock, and stmt.
Referenced by ProcessUtilitySlow(), and standard_ProcessUtility().
char * GetSecurityLabel | ( | const ObjectAddress * | object, |
const char * | provider | ||
) |
Definition at line 272 of file seclabel.c.
References AccessShareLock, BTEqualStrategyNumber, ObjectAddress::classId, CStringGetTextDatum, GetSharedSecurityLabel(), heap_getattr(), HeapTupleIsValid, Int32GetDatum(), IsSharedRelation(), ObjectAddress::objectId, ObjectIdGetDatum(), ObjectAddress::objectSubId, provider, RelationGetDescr, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), table_open(), and TextDatumGetCString.
Referenced by sepgsql_avc_check_perms(), sepgsql_avc_trusted_proc(), and sepgsql_get_label().
void register_label_provider | ( | const char * | provider_name, |
check_object_relabel_type | hook | ||
) |
Definition at line 570 of file seclabel.c.
References label_provider_list, lappend(), MemoryContextSwitchTo(), palloc(), provider, pstrdup(), and TopMemoryContext.
Referenced by _PG_init().
void SetSecurityLabel | ( | const ObjectAddress * | object, |
const char * | provider, | ||
const char * | label | ||
) |
Definition at line 404 of file seclabel.c.
References BTEqualStrategyNumber, CatalogTupleDelete(), CatalogTupleInsert(), CatalogTupleUpdate(), ObjectAddress::classId, CStringGetTextDatum, heap_form_tuple(), heap_freetuple(), heap_modify_tuple(), HeapTupleIsValid, Int32GetDatum(), IsSharedRelation(), label, ObjectAddress::objectId, ObjectIdGetDatum(), ObjectAddress::objectSubId, provider, RelationGetDescr, RowExclusiveLock, ScanKeyInit(), SetSharedSecurityLabel(), systable_beginscan(), systable_endscan(), systable_getnext(), HeapTupleData::t_self, table_close(), table_open(), and values.
Referenced by exec_object_restorecon(), ExecSecLabelStmt(), sepgsql_attribute_post_create(), sepgsql_database_post_create(), sepgsql_proc_post_create(), sepgsql_relation_post_create(), and sepgsql_schema_post_create().