PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/genam.h"
#include "access/htup_details.h"
#include "access/sysattr.h"
#include "access/table.h"
#include "catalog/dependency.h"
#include "catalog/pg_attribute.h"
#include "catalog/pg_class.h"
#include "catalog/pg_namespace.h"
#include "commands/seclabel.h"
#include "lib/stringinfo.h"
#include "sepgsql.h"
#include "utils/builtins.h"
#include "utils/catcache.h"
#include "utils/fmgroids.h"
#include "utils/lsyscache.h"
#include "utils/rel.h"
#include "utils/snapmgr.h"
#include "utils/syscache.h"
Go to the source code of this file.
Functions | |
static void | sepgsql_index_modify (Oid indexOid) |
void | sepgsql_attribute_post_create (Oid relOid, AttrNumber attnum) |
void | sepgsql_attribute_drop (Oid relOid, AttrNumber attnum) |
void | sepgsql_attribute_relabel (Oid relOid, AttrNumber attnum, const char *seclabel) |
void | sepgsql_attribute_setattr (Oid relOid, AttrNumber attnum) |
void | sepgsql_relation_post_create (Oid relOid) |
void | sepgsql_relation_drop (Oid relOid) |
void | sepgsql_relation_truncate (Oid relOid) |
void | sepgsql_relation_relabel (Oid relOid, const char *seclabel) |
void | sepgsql_relation_setattr (Oid relOid) |
static void | sepgsql_relation_setattr_extra (Relation catalog, Oid catindex_id, Oid extra_oid, AttrNumber anum_relation_id, AttrNumber anum_extra_id) |
void sepgsql_attribute_drop | ( | Oid | relOid, |
AttrNumber | attnum | ||
) |
Definition at line 133 of file relation.c.
References attnum, get_rel_relkind(), getObjectIdentity(), pfree(), SEPG_CLASS_DB_COLUMN, SEPG_DB_COLUMN__DROP, and sepgsql_avc_check_perms().
Referenced by sepgsql_object_access().
void sepgsql_attribute_post_create | ( | Oid | relOid, |
AttrNumber | attnum | ||
) |
Definition at line 43 of file relation.c.
References AccessShareLock, appendStringInfo(), attnum, BTEqualStrategyNumber, StringInfoData::data, elog, ERROR, get_rel_relkind(), getObjectIdentity(), GETSTRUCT, HeapTupleIsValid, initStringInfo(), Int16GetDatum(), NameStr, ObjectIdGetDatum(), pfree(), quote_identifier(), ScanKeyInit(), SEPG_CLASS_DB_COLUMN, SEPG_DB_COLUMN__CREATE, sepgsql_avc_check_perms_label(), sepgsql_compute_create(), sepgsql_get_client_label(), sepgsql_get_label(), SEPGSQL_LABEL_TAG, SetSecurityLabel(), SnapshotSelf, systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by sepgsql_object_access().
void sepgsql_attribute_relabel | ( | Oid | relOid, |
AttrNumber | attnum, | ||
const char * | seclabel | ||
) |
Definition at line 165 of file relation.c.
References attnum, ereport, errcode(), errmsg(), ERROR, get_rel_relkind(), getObjectIdentity(), pfree(), SEPG_CLASS_DB_COLUMN, SEPG_DB_COLUMN__RELABELFROM, SEPG_DB_COLUMN__SETATTR, SEPG_DB_PROCEDURE__RELABELTO, sepgsql_avc_check_perms(), and sepgsql_avc_check_perms_label().
Referenced by sepgsql_object_relabel().
void sepgsql_attribute_setattr | ( | Oid | relOid, |
AttrNumber | attnum | ||
) |
Definition at line 209 of file relation.c.
References attnum, get_rel_relkind(), getObjectIdentity(), pfree(), SEPG_CLASS_DB_COLUMN, SEPG_DB_COLUMN__SETATTR, and sepgsql_avc_check_perms().
Referenced by sepgsql_object_access().
|
static |
Definition at line 762 of file relation.c.
References AccessShareLock, sepgsql_relation_setattr_extra(), table_close(), and table_open().
Referenced by sepgsql_relation_drop(), sepgsql_relation_post_create(), and sepgsql_relation_setattr().
void sepgsql_relation_drop | ( | Oid | relOid | ) |
Definition at line 416 of file relation.c.
References get_rel_namespace(), get_rel_relkind(), getObjectIdentity(), GETSTRUCT, i, catclist::members, catclist::n_members, ObjectIdGetDatum(), pfree(), ReleaseCatCacheList(), SearchSysCacheList1, SEPG_CLASS_DB_COLUMN, SEPG_CLASS_DB_SCHEMA, SEPG_CLASS_DB_SEQUENCE, SEPG_CLASS_DB_TABLE, SEPG_CLASS_DB_VIEW, SEPG_DB_COLUMN__DROP, SEPG_DB_SCHEMA__REMOVE_NAME, SEPG_DB_TABLE__DROP, sepgsql_avc_check_perms(), sepgsql_index_modify(), and catctup::tuple.
Referenced by sepgsql_object_access().
void sepgsql_relation_post_create | ( | Oid | relOid | ) |
Definition at line 240 of file relation.c.
References AccessShareLock, appendStringInfo(), BTEqualStrategyNumber, StringInfoData::data, elog, ERROR, get_namespace_name(), getObjectIdentity(), GETSTRUCT, HeapTupleIsValid, initStringInfo(), NameStr, ObjectIdGetDatum(), pfree(), quote_identifier(), resetStringInfo(), ScanKeyInit(), SEPG_CLASS_DB_COLUMN, SEPG_CLASS_DB_SCHEMA, SEPG_CLASS_DB_SEQUENCE, SEPG_CLASS_DB_TABLE, SEPG_CLASS_DB_VIEW, SEPG_DB_COLUMN__CREATE, SEPG_DB_DATABASE__CREATE, SEPG_DB_SCHEMA__ADD_NAME, sepgsql_avc_check_perms(), sepgsql_avc_check_perms_label(), sepgsql_compute_create(), sepgsql_get_client_label(), sepgsql_get_label(), sepgsql_index_modify(), SEPGSQL_LABEL_TAG, SetSecurityLabel(), SnapshotSelf, systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by sepgsql_object_access().
void sepgsql_relation_relabel | ( | Oid | relOid, |
const char * | seclabel | ||
) |
Definition at line 564 of file relation.c.
References ereport, errcode(), errmsg(), ERROR, get_rel_relkind(), getObjectIdentity(), pfree(), SEPG_CLASS_DB_SEQUENCE, SEPG_CLASS_DB_TABLE, SEPG_CLASS_DB_VIEW, SEPG_DB_TABLE__RELABELFROM, SEPG_DB_TABLE__RELABELTO, SEPG_DB_TABLE__SETATTR, sepgsql_avc_check_perms(), and sepgsql_avc_check_perms_label().
Referenced by sepgsql_object_relabel().
void sepgsql_relation_setattr | ( | Oid | relOid | ) |
Definition at line 615 of file relation.c.
References AccessShareLock, BTEqualStrategyNumber, elog, ERROR, get_rel_relkind(), getObjectIdentity(), GETSTRUCT, HeapTupleIsValid, NameStr, ObjectIdGetDatum(), pfree(), ReleaseSysCache(), ScanKeyInit(), SearchSysCache1(), SEPG_CLASS_DB_SEQUENCE, SEPG_CLASS_DB_TABLE, SEPG_CLASS_DB_VIEW, SEPG_DB_TABLE__SETATTR, sepgsql_avc_check_perms(), sepgsql_index_modify(), sepgsql_schema_add_name(), sepgsql_schema_remove_name(), sepgsql_schema_rename(), SnapshotSelf, systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by sepgsql_object_access(), and sepgsql_relation_setattr_extra().
|
static |
Definition at line 721 of file relation.c.
References Assert, BTEqualStrategyNumber, DatumGetObjectId(), elog, ERROR, heap_getattr(), HeapTupleIsValid, ObjectIdGetDatum(), RelationGetDescr, RelationGetRelationName, ScanKeyInit(), sepgsql_relation_setattr(), SnapshotSelf, systable_beginscan(), systable_endscan(), and systable_getnext().
Referenced by sepgsql_index_modify().
void sepgsql_relation_truncate | ( | Oid | relOid | ) |
Definition at line 524 of file relation.c.
References get_rel_relkind(), getObjectIdentity(), pfree(), SEPG_CLASS_DB_TABLE, SEPG_DB_TABLE__TRUNCATE, and sepgsql_avc_check_perms().
Referenced by sepgsql_object_access().