55 elog(
ERROR,
"cache lookup failed for relation %u", relOid);
63 for (attno = 1; attno <= natts; attno++)
101 if (parentId == childId)
123 elog(
ERROR,
"cache lookup failed for attribute %s of relation %u",
147 bool abort_on_violation)
168 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
169 errmsg(
"SELinux: hardwired security policy violation")));
171 if (relkind == RELKIND_TOASTVALUE)
173 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
174 errmsg(
"SELinux: hardwired security policy violation")));
180 object.classId = RelationRelationId;
181 object.objectId = relOid;
182 object.objectSubId = 0;
186 case RELKIND_RELATION:
187 case RELKIND_PARTITIONED_TABLE:
195 case RELKIND_SEQUENCE:
223 if (relkind != RELKIND_RELATION && relkind != RELKIND_PARTITIONED_TABLE)
252 if (column_perms == 0)
258 object.classId = RelationRelationId;
259 object.objectId = relOid;
260 object.objectSubId =
attnum;
283 bool abort_on_violation)
287 foreach(lr, rteperminfos)
328 foreach(li, tableIds)
#define InvalidAttrNumber
int bms_next_member(const Bitmapset *a, int prevbit)
bool bms_is_member(int x, const Bitmapset *a)
Bitmapset * bms_add_member(Bitmapset *a, int x)
Bitmapset * bms_union(const Bitmapset *a, const Bitmapset *b)
Bitmapset * bms_del_member(Bitmapset *a, int x)
Bitmapset * bms_copy(const Bitmapset *a)
#define Assert(condition)
bool IsCatalogRelationOid(Oid relid)
bool sepgsql_dml_privileges(List *rangeTbls, List *rteperminfos, bool abort_on_violation)
static Bitmapset * fixup_whole_row_references(Oid relOid, Bitmapset *columns)
static Bitmapset * fixup_inherited_columns(Oid parentId, Oid childId, Bitmapset *columns)
static bool check_relation_privileges(Oid relOid, Bitmapset *selected, Bitmapset *inserted, Bitmapset *updated, uint32 required, bool abort_on_violation)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define HeapTupleIsValid(tuple)
void list_free(List *list)
AttrNumber get_attnum(Oid relid, const char *attname)
char get_rel_relkind(Oid relid)
char * get_attname(Oid relid, AttrNumber attnum, bool missing_ok)
void pfree(void *pointer)
char * getObjectDescription(const ObjectAddress *object, bool missing_ok)
char * getObjectIdentity(const ObjectAddress *object, bool missing_ok)
FormData_pg_attribute * Form_pg_attribute
FormData_pg_class * Form_pg_class
List * find_all_inheritors(Oid parentrelId, LOCKMODE lockmode, List **numparents)
#define lfirst_node(type, lc)
#define list_make1_oid(x1)
static Datum Int16GetDatum(int16 X)
static Datum ObjectIdGetDatum(Oid X)
bool sepgsql_getenforce(void)
#define SEPG_CLASS_DB_TABLE
#define SEPG_DB_TABLE__DELETE
#define SEPG_DB_TABLE__LOCK
#define SEPG_DB_TABLE__INSERT
#define SEPG_DB_TABLE__UPDATE
#define SEPG_DB_VIEW__EXPAND
#define SEPG_CLASS_DB_COLUMN
#define SEPG_DB_COLUMN__INSERT
#define SEPG_DB_COLUMN__SELECT
#define SEPG_DB_TABLE__SELECT
#define SEPG_DB_COLUMN__UPDATE
#define SEPG_CLASS_DB_VIEW
#define SEPG_CLASS_DB_SEQUENCE
#define SEPG_DB_SEQUENCE__GET_VALUE
bool sepgsql_avc_check_perms(const ObjectAddress *tobject, uint16 tclass, uint32 required, const char *audit_name, bool abort_on_violation)
#define FirstLowInvalidHeapAttributeNumber
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
HeapTuple SearchSysCache2(int cacheId, Datum key1, Datum key2)