PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <ctype.h>
#include "access/htup_details.h"
#include "catalog/catalog.h"
#include "catalog/namespace.h"
#include "catalog/pg_auth_members.h"
#include "catalog/pg_authid.h"
#include "catalog/pg_class.h"
#include "catalog/pg_database.h"
#include "catalog/pg_foreign_data_wrapper.h"
#include "catalog/pg_foreign_server.h"
#include "catalog/pg_language.h"
#include "catalog/pg_namespace.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_tablespace.h"
#include "catalog/pg_type.h"
#include "commands/dbcommands.h"
#include "commands/proclang.h"
#include "commands/tablespace.h"
#include "common/hashfn.h"
#include "foreign/foreign.h"
#include "funcapi.h"
#include "lib/bloomfilter.h"
#include "lib/qunique.h"
#include "miscadmin.h"
#include "utils/acl.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "utils/catcache.h"
#include "utils/inval.h"
#include "utils/lsyscache.h"
#include "utils/memutils.h"
#include "utils/syscache.h"
#include "utils/varlena.h"
Go to the source code of this file.
Data Structures | |
struct | priv_map |
Macros | |
#define | ROLES_LIST_BLOOM_THRESHOLD 1024 |
Enumerations | |
enum | RoleRecurseType { ROLERECURSE_MEMBERS = 0 , ROLERECURSE_PRIVS = 1 , ROLERECURSE_SETROLE = 2 } |
Variables | |
static Oid | cached_role [] = {InvalidOid, InvalidOid, InvalidOid} |
static List * | cached_roles [] = {NIL, NIL, NIL} |
static uint32 | cached_db_hash |
enum RoleRecurseType |
Definition at line 460 of file acl.c.
References ACL_DAT, ACL_NUM, and allocacl().
Referenced by ExecGrant_Attribute().
Datum aclcontains | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1595 of file acl.c.
References ACL_DAT, ACL_NUM, ACLITEM_GET_RIGHTS, AclItem::ai_grantee, AclItem::ai_grantor, check_acl(), i, PG_GETARG_ACL_P, PG_GETARG_ACLITEM_P, and PG_RETURN_BOOL.
Definition at line 440 of file acl.c.
References ACL_DAT, ACL_NUM, and allocacl().
Referenced by aclmerge(), ExecGrant_Relation(), and SetDefaultACL().
Acl* acldefault | ( | ObjectType | objtype, |
Oid | ownerId | ||
) |
Definition at line 786 of file acl.c.
References ACL_ALL_RIGHTS_DATABASE, ACL_ALL_RIGHTS_FDW, ACL_ALL_RIGHTS_FOREIGN_SERVER, ACL_ALL_RIGHTS_FUNCTION, ACL_ALL_RIGHTS_LANGUAGE, ACL_ALL_RIGHTS_LARGEOBJECT, ACL_ALL_RIGHTS_PARAMETER_ACL, ACL_ALL_RIGHTS_RELATION, ACL_ALL_RIGHTS_SCHEMA, ACL_ALL_RIGHTS_SEQUENCE, ACL_ALL_RIGHTS_TABLESPACE, ACL_ALL_RIGHTS_TYPE, ACL_CONNECT, ACL_CREATE_TEMP, ACL_DAT, ACL_EXECUTE, ACL_ID_PUBLIC, ACL_NO_RIGHTS, ACL_USAGE, ACLITEM_SET_PRIVS_GOPTIONS, AclItem::ai_grantee, AclItem::ai_grantor, allocacl(), elog, ERROR, OBJECT_COLUMN, OBJECT_DATABASE, OBJECT_DOMAIN, OBJECT_FDW, OBJECT_FOREIGN_SERVER, OBJECT_FUNCTION, OBJECT_LANGUAGE, OBJECT_LARGEOBJECT, OBJECT_PARAMETER_ACL, OBJECT_SCHEMA, OBJECT_SEQUENCE, OBJECT_TABLE, OBJECT_TABLESPACE, and OBJECT_TYPE.
Referenced by acldefault_sql(), buildDefaultACLCommands(), dumpACL(), dumpRoleGUCPrivs(), dumpTable(), dumpTablespaces(), ExecGrant_Attribute(), ExecGrant_common(), ExecGrant_Largeobject(), ExecGrant_Parameter(), ExecGrant_Relation(), get_user_default_acl(), object_aclmask_ext(), pg_class_aclmask_ext(), pg_largeobject_aclmask_snapshot(), pg_namespace_aclmask_ext(), pg_parameter_acl_aclmask(), pg_parameter_aclmask(), pg_type_aclmask_ext(), and SetDefaultACL().
Datum acldefault_sql | ( | PG_FUNCTION_ARGS | ) |
Definition at line 903 of file acl.c.
References acldefault(), elog, ERROR, OBJECT_COLUMN, OBJECT_DATABASE, OBJECT_FDW, OBJECT_FOREIGN_SERVER, OBJECT_FUNCTION, OBJECT_LANGUAGE, OBJECT_LARGEOBJECT, OBJECT_PARAMETER_ACL, OBJECT_SCHEMA, OBJECT_SEQUENCE, OBJECT_TABLE, OBJECT_TABLESPACE, OBJECT_TYPE, PG_GETARG_CHAR, PG_GETARG_OID, and PG_RETURN_ACL_P.
Definition at line 542 of file acl.c.
References ACL_DAT, and ACL_NUM.
Referenced by ExecGrant_Parameter(), get_user_default_acl(), and SetDefaultACL().
Datum aclexplode | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1774 of file acl.c.
References ACL_DAT, ACL_NUM, ACLITEM_GET_GOPTIONS, ACLITEM_GET_PRIVS, AclItem::ai_grantee, AclItem::ai_grantor, BlessTupleDesc(), BoolGetDatum(), check_acl(), convert_aclright_to_string(), CreateTemplateTupleDesc(), CStringGetTextDatum, heap_form_tuple(), HeapTupleGetDatum(), idx(), MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, N_ACL_RIGHTS, ObjectIdGetDatum(), palloc(), PG_GETARG_ACL_P, SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, FuncCallContext::tuple_desc, TupleDescInitEntry(), FuncCallContext::user_fctx, and values.
Datum aclinsert | ( | PG_FUNCTION_ARGS | ) |
Datum aclitem_eq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 696 of file acl.c.
Referenced by aclnewowner(), and aclupdate().
|
static |
Datum aclitemin | ( | PG_FUNCTION_ARGS | ) |
Definition at line 598 of file acl.c.
References aclparse(), ereturn, errcode(), errmsg(), palloc(), PG_GETARG_CSTRING, PG_RETURN_ACLITEM_P, and PG_RETURN_NULL.
Datum aclitemout | ( | PG_FUNCTION_ARGS | ) |
Definition at line 629 of file acl.c.
References ACL_ALL_RIGHTS_STR, ACL_ID_PUBLIC, ACLITEM_GET_GOPTIONS, ACLITEM_GET_PRIVS, AclItem::ai_grantee, AclItem::ai_grantor, GETSTRUCT, HeapTupleIsValid, i, N_ACL_RIGHTS, NAMEDATALEN, NameStr, ObjectIdGetDatum(), palloc(), PG_GETARG_ACLITEM_P, PG_RETURN_CSTRING, putid(), ReleaseSysCache(), rolname, SearchSysCache1(), and sprintf.
void aclitemsort | ( | Acl * | acl | ) |
Definition at line 528 of file acl.c.
References ACL_DAT, ACL_NUM, aclitemComparator(), and qsort.
Referenced by get_user_default_acl(), and SetDefaultACL().
Definition at line 1371 of file acl.c.
References ACL_DAT, ACL_ID_PUBLIC, ACL_NUM, ACLITEM_ALL_GOPTION_BITS, ACLMASK_ALL, AclItem::ai_grantee, AclItem::ai_privs, check_acl(), elog, ERROR, has_privs_of_role(), i, and remaining.
Referenced by check_circularity(), LockTableAclCheck(), object_aclmask_ext(), pg_attribute_aclcheck_all_ext(), pg_attribute_aclmask_ext(), pg_class_aclmask_ext(), pg_largeobject_aclmask_snapshot(), pg_namespace_aclmask_ext(), pg_parameter_acl_aclmask(), pg_parameter_aclmask(), pg_type_aclmask_ext(), and recursive_revoke().
|
static |
Definition at line 1460 of file acl.c.
References ACL_DAT, ACL_NUM, ACLITEM_ALL_GOPTION_BITS, ACLMASK_ALL, AclItem::ai_grantee, AclItem::ai_privs, check_acl(), elog, ERROR, and i.
Referenced by select_best_grantor().
Definition at line 1523 of file acl.c.
References ACL_DAT, ACL_ID_PUBLIC, ACL_NUM, AclItem::ai_grantee, AclItem::ai_grantor, check_acl(), i, j, sort-test::list, oid_cmp(), palloc(), qsort, and qunique().
Referenced by ExecGrant_Attribute(), ExecGrant_common(), ExecGrant_Largeobject(), ExecGrant_Parameter(), ExecGrant_Relation(), recordDependencyOnNewAcl(), recordExtensionInitPrivWorker(), RemoveRoleFromInitPriv(), ReplaceRoleInInitPriv(), and SetDefaultACL().
Definition at line 484 of file acl.c.
References ACL_DAT, ACL_MODECHG_ADD, ACL_NUM, aclcopy(), aclupdate(), DROP_RESTRICT, i, and pfree().
Referenced by get_user_default_acl().
Definition at line 1102 of file acl.c.
References ACL_DAT, ACL_N_SIZE, ACL_NO_RIGHTS, ACL_NUM, ACLITEM_GET_RIGHTS, aclitem_match(), ACLITEM_SET_RIGHTS, AclItem::ai_grantee, AclItem::ai_grantor, allocacl(), ARR_DIMS, check_acl(), and SET_VARSIZE.
Referenced by AlterDatabaseOwner(), AlterForeignDataWrapperOwner_internal(), AlterForeignServerOwner_internal(), AlterObjectOwner_internal(), AlterSchemaOwner_internal(), AlterTypeOwnerInternal(), ATExecChangeOwner(), change_owner_fix_column_acls(), and ReplaceRoleInInitPriv().
Definition at line 253 of file acl.c.
References ACL_ALL_RIGHTS_STR, ACL_ALTER_SYSTEM, ACL_ALTER_SYSTEM_CHR, ACL_CONNECT, ACL_CONNECT_CHR, ACL_CREATE, ACL_CREATE_CHR, ACL_CREATE_TEMP, ACL_CREATE_TEMP_CHR, ACL_DELETE, ACL_DELETE_CHR, ACL_EXECUTE, ACL_EXECUTE_CHR, ACL_ID_PUBLIC, ACL_INSERT, ACL_INSERT_CHR, ACL_MAINTAIN, ACL_MAINTAIN_CHR, ACL_NO_RIGHTS, ACL_REFERENCES, ACL_REFERENCES_CHR, ACL_SELECT, ACL_SELECT_CHR, ACL_SET, ACL_SET_CHR, ACL_TRIGGER, ACL_TRIGGER_CHR, ACL_TRUNCATE, ACL_TRUNCATE_CHR, ACL_UPDATE, ACL_UPDATE_CHR, ACL_USAGE, ACL_USAGE_CHR, ACLITEM_SET_PRIVS_GOPTIONS, AclItem::ai_grantee, AclItem::ai_grantor, Assert, ereport, ereturn, errcode(), errhint(), errmsg(), get_role_oid(), getid(), name, NAMEDATALEN, OidIsValid, read, and WARNING.
Referenced by aclitemin().
Datum aclremove | ( | PG_FUNCTION_ARGS | ) |
Acl* aclupdate | ( | const Acl * | old_acl, |
const AclItem * | mod_aip, | ||
int | modechg, | ||
Oid | ownerId, | ||
DropBehavior | behavior | ||
) |
Definition at line 975 of file acl.c.
References ACL_DAT, ACL_ID_PUBLIC, ACL_MODECHG_ADD, ACL_MODECHG_DEL, ACL_MODECHG_EQL, ACL_N_SIZE, ACL_NO_RIGHTS, ACL_NUM, ACL_SIZE, ACLITEM_GET_GOPTIONS, ACLITEM_GET_RIGHTS, aclitem_match(), ACLITEM_SET_PRIVS_GOPTIONS, ACLITEM_SET_RIGHTS, AclItem::ai_grantee, AclItem::ai_grantor, allocacl(), ARR_DIMS, Assert, check_acl(), check_circularity(), recursive_revoke(), and SET_VARSIZE.
Referenced by aclmerge(), check_circularity(), merge_acl_with_grant(), and recursive_revoke().
|
static |
Definition at line 409 of file acl.c.
References ACL_N_SIZE, ARR_DIMS, ARR_LBOUND, ArrayType::dataoffset, ArrayType::elemtype, elog, ERROR, ArrayType::ndim, palloc0(), SET_VARSIZE, and size.
Referenced by aclconcat(), aclcopy(), acldefault(), aclnewowner(), aclupdate(), check_circularity(), and make_empty_acl().
|
static |
Definition at line 573 of file acl.c.
References ARR_ELEMTYPE, ARR_HASNULL, ARR_NDIM, ereport, errcode(), errmsg(), and ERROR.
Referenced by aclcontains(), aclexplode(), aclmask(), aclmask_direct(), aclmembers(), aclnewowner(), aclupdate(), check_circularity(), and recursive_revoke().
Definition at line 5191 of file acl.c.
References ereport, errcode(), errmsg(), ERROR, GetUserNameFromId(), and member_can_set_role().
Referenced by AlterDatabaseOwner(), AlterForeignServerOwner_internal(), AlterObjectOwner_internal(), AlterPublicationOwner_internal(), AlterSchemaOwner_internal(), AlterSubscriptionOwner_internal(), AlterTypeOwner(), ATExecChangeOwner(), createdb(), and CreateSchemaCommand().
Definition at line 1205 of file acl.c.
References ACL_DAT, ACL_GRANT_OPTION_FOR, ACL_ID_PUBLIC, ACL_MODECHG_DEL, ACL_NO_RIGHTS, ACL_NUM, ACL_OPTION_TO_PRIVS, ACL_SIZE, ACLITEM_GET_GOPTIONS, aclmask(), ACLMASK_ALL, aclupdate(), AclItem::ai_grantee, AclItem::ai_grantor, allocacl(), Assert, check_acl(), DROP_CASCADE, ereport, errcode(), errmsg(), ERROR, i, and pfree().
Referenced by aclupdate().
void check_rolespec_name | ( | const RoleSpec * | role, |
const char * | detail_msg | ||
) |
Definition at line 5561 of file acl.c.
References ereport, errcode(), errdetail_internal(), errmsg(), ERROR, IsReservedName(), RoleSpec::rolename, ROLESPEC_CSTRING, and RoleSpec::roletype.
Referenced by AlterRole(), and AlterRoleSet().
|
static |
Definition at line 2521 of file acl.c.
References ACLCHECK_OK, attnum, InvalidAttrNumber, mode, pg_attribute_aclcheck_ext(), and pg_class_aclcheck_ext().
Referenced by has_column_privilege_id_attnum(), has_column_privilege_id_id_attnum(), has_column_privilege_id_id_name(), has_column_privilege_id_name(), has_column_privilege_id_name_attnum(), has_column_privilege_id_name_name(), has_column_privilege_name_attnum(), has_column_privilege_name_id_attnum(), has_column_privilege_name_id_name(), has_column_privilege_name_name(), has_column_privilege_name_name_attnum(), and has_column_privilege_name_name_name().
|
static |
Definition at line 1718 of file acl.c.
References ACL_ALTER_SYSTEM, ACL_CONNECT, ACL_CREATE, ACL_CREATE_TEMP, ACL_DELETE, ACL_EXECUTE, ACL_INSERT, ACL_MAINTAIN, ACL_REFERENCES, ACL_SELECT, ACL_SET, ACL_TRIGGER, ACL_TRUNCATE, ACL_UPDATE, ACL_USAGE, elog, and ERROR.
Referenced by aclexplode().
|
static |
Definition at line 1670 of file acl.c.
References chunk, ereport, errcode(), errmsg(), ERROR, priv_map::name, pfree(), pg_strcasecmp(), text_to_cstring(), and priv_map::value.
Referenced by convert_column_priv_string(), convert_database_priv_string(), convert_foreign_data_wrapper_priv_string(), convert_function_priv_string(), convert_language_priv_string(), convert_parameter_priv_string(), convert_role_priv_string(), convert_schema_priv_string(), convert_sequence_priv_string(), convert_server_priv_string(), convert_table_priv_string(), convert_tablespace_priv_string(), convert_type_priv_string(), and makeaclitem().
|
static |
Definition at line 2881 of file acl.c.
References attnum, CStringGetDatum(), ereport, errcode(), errmsg(), ERROR, get_rel_name(), GETSTRUCT, HeapTupleIsValid, InvalidAttrNumber, ObjectIdGetDatum(), pfree(), ReleaseSysCache(), SearchSysCache2(), and text_to_cstring().
Referenced by has_column_privilege_id_id_name(), has_column_privilege_id_name(), has_column_privilege_id_name_name(), has_column_privilege_name_id_name(), has_column_privilege_name_name(), and has_column_privilege_name_name_name().
Definition at line 2939 of file acl.c.
References ACL_GRANT_OPTION_FOR, ACL_INSERT, ACL_REFERENCES, ACL_SELECT, ACL_UPDATE, and convert_any_priv_string().
Referenced by has_any_column_privilege_id(), has_any_column_privilege_id_id(), has_any_column_privilege_id_name(), has_any_column_privilege_name(), has_any_column_privilege_name_id(), has_any_column_privilege_name_name(), has_column_privilege_id_attnum(), has_column_privilege_id_id_attnum(), has_column_privilege_id_id_name(), has_column_privilege_id_name(), has_column_privilege_id_name_attnum(), has_column_privilege_id_name_name(), has_column_privilege_name_attnum(), has_column_privilege_name_id_attnum(), has_column_privilege_name_id_name(), has_column_privilege_name_name(), has_column_privilege_name_name_attnum(), and has_column_privilege_name_name_name().
Definition at line 3133 of file acl.c.
References dbname, get_database_oid(), and text_to_cstring().
Referenced by has_database_privilege_id_name(), has_database_privilege_name(), and has_database_privilege_name_name().
Definition at line 3145 of file acl.c.
References ACL_CONNECT, ACL_CREATE, ACL_CREATE_TEMP, ACL_GRANT_OPTION_FOR, and convert_any_priv_string().
Referenced by has_database_privilege_id(), has_database_privilege_id_id(), has_database_privilege_id_name(), has_database_privilege_name(), has_database_privilege_name_id(), and has_database_privilege_name_name().
Definition at line 3339 of file acl.c.
References get_foreign_data_wrapper_oid(), and text_to_cstring().
Referenced by has_foreign_data_wrapper_privilege_id_name(), has_foreign_data_wrapper_privilege_name(), and has_foreign_data_wrapper_privilege_name_name().
Definition at line 3351 of file acl.c.
References ACL_GRANT_OPTION_FOR, ACL_USAGE, and convert_any_priv_string().
Referenced by has_foreign_data_wrapper_privilege_id(), has_foreign_data_wrapper_privilege_id_id(), has_foreign_data_wrapper_privilege_id_name(), has_foreign_data_wrapper_privilege_name(), has_foreign_data_wrapper_privilege_name_id(), and has_foreign_data_wrapper_privilege_name_name().
Definition at line 3539 of file acl.c.
References CStringGetDatum(), DatumGetObjectId(), DirectFunctionCall1, ereport, errcode(), errmsg(), ERROR, funcname, OidIsValid, regprocedurein(), and text_to_cstring().
Referenced by has_function_privilege_id_name(), has_function_privilege_name(), and has_function_privilege_name_name().
Definition at line 3560 of file acl.c.
References ACL_EXECUTE, ACL_GRANT_OPTION_FOR, and convert_any_priv_string().
Referenced by has_function_privilege_id(), has_function_privilege_id_id(), has_function_privilege_id_name(), has_function_privilege_name(), has_function_privilege_name_id(), and has_function_privilege_name_name().
Definition at line 3748 of file acl.c.
References get_language_oid(), and text_to_cstring().
Referenced by has_language_privilege_id_name(), has_language_privilege_name(), and has_language_privilege_name_name().
Definition at line 3760 of file acl.c.
References ACL_GRANT_OPTION_FOR, ACL_USAGE, and convert_any_priv_string().
Referenced by has_language_privilege_id(), has_language_privilege_id_id(), has_language_privilege_id_name(), has_language_privilege_name(), has_language_privilege_name_id(), and has_language_privilege_name_name().
Definition at line 4659 of file acl.c.
References ACL_ALTER_SYSTEM, ACL_GRANT_OPTION_FOR, ACL_SET, and convert_any_priv_string().
Referenced by has_parameter_privilege_id_name(), has_parameter_privilege_name(), and has_parameter_privilege_name_name().
Definition at line 4837 of file acl.c.
References ACL_CREATE, ACL_GRANT_OPTION_FOR, ACL_SET, ACL_USAGE, and convert_any_priv_string().
Referenced by pg_has_role_id(), pg_has_role_id_id(), pg_has_role_id_name(), pg_has_role_name(), pg_has_role_name_id(), and pg_has_role_name_name().
Definition at line 3948 of file acl.c.
References get_namespace_oid(), and text_to_cstring().
Referenced by has_schema_privilege_id_name(), has_schema_privilege_name(), and has_schema_privilege_name_name().
Definition at line 3960 of file acl.c.
References ACL_CREATE, ACL_GRANT_OPTION_FOR, ACL_USAGE, and convert_any_priv_string().
Referenced by has_schema_privilege_id(), has_schema_privilege_id_id(), has_schema_privilege_id_name(), has_schema_privilege_name(), has_schema_privilege_name_id(), and has_schema_privilege_name_name().
Definition at line 2284 of file acl.c.
References ACL_GRANT_OPTION_FOR, ACL_SELECT, ACL_UPDATE, ACL_USAGE, and convert_any_priv_string().
Referenced by has_sequence_privilege_id(), has_sequence_privilege_id_id(), has_sequence_privilege_id_name(), has_sequence_privilege_name(), has_sequence_privilege_name_id(), and has_sequence_privilege_name_name().
Definition at line 4150 of file acl.c.
References get_foreign_server_oid(), and text_to_cstring().
Referenced by has_server_privilege_id_name(), has_server_privilege_name(), and has_server_privilege_name_name().
Definition at line 4162 of file acl.c.
References ACL_GRANT_OPTION_FOR, ACL_USAGE, and convert_any_priv_string().
Referenced by has_server_privilege_id(), has_server_privilege_id_id(), has_server_privilege_id_name(), has_server_privilege_name(), has_server_privilege_name_id(), and has_server_privilege_name_name().
Definition at line 2032 of file acl.c.
References makeRangeVarFromNameList(), NoLock, RangeVarGetRelid, and textToQualifiedNameList().
Referenced by has_any_column_privilege_id_name(), has_any_column_privilege_name(), has_any_column_privilege_name_name(), has_column_privilege_id_name_attnum(), has_column_privilege_id_name_name(), has_column_privilege_name_attnum(), has_column_privilege_name_name(), has_column_privilege_name_name_attnum(), has_column_privilege_name_name_name(), has_sequence_privilege_id_name(), has_sequence_privilege_name(), has_sequence_privilege_name_name(), has_table_privilege_id_name(), has_table_privilege_name(), and has_table_privilege_name_name().
Definition at line 2047 of file acl.c.
References ACL_DELETE, ACL_GRANT_OPTION_FOR, ACL_INSERT, ACL_MAINTAIN, ACL_REFERENCES, ACL_SELECT, ACL_TRIGGER, ACL_TRUNCATE, ACL_UPDATE, and convert_any_priv_string().
Referenced by has_table_privilege_id(), has_table_privilege_id_id(), has_table_privilege_id_name(), has_table_privilege_name(), has_table_privilege_name_id(), and has_table_privilege_name_name().
Definition at line 4350 of file acl.c.
References get_tablespace_oid(), and text_to_cstring().
Referenced by has_tablespace_privilege_id_name(), has_tablespace_privilege_name(), and has_tablespace_privilege_name_name().
Definition at line 4362 of file acl.c.
References ACL_CREATE, ACL_GRANT_OPTION_FOR, and convert_any_priv_string().
Referenced by has_tablespace_privilege_id(), has_tablespace_privilege_id_id(), has_tablespace_privilege_id_name(), has_tablespace_privilege_name(), has_tablespace_privilege_name_id(), and has_tablespace_privilege_name_name().
Definition at line 4549 of file acl.c.
References CStringGetDatum(), DatumGetObjectId(), DirectFunctionCall1, ereport, errcode(), errmsg(), ERROR, OidIsValid, regtypein(), text_to_cstring(), and typname.
Referenced by has_type_privilege_id_name(), has_type_privilege_name(), and has_type_privilege_name_name().
Definition at line 4570 of file acl.c.
References ACL_GRANT_OPTION_FOR, ACL_USAGE, and convert_any_priv_string().
Referenced by has_type_privilege_id(), has_type_privilege_id_id(), has_type_privilege_id_name(), has_type_privilege_name(), has_type_privilege_name_id(), and has_type_privilege_name_name().
|
static |
Definition at line 5420 of file acl.c.
References CStringGetDatum(), ereport, errcode(), errmsg(), ERROR, GetSysCacheOid1, OidIsValid, and rolname.
Referenced by aclparse(), check_hba(), check_ident_usermap(), createdb(), CreateRole(), get_object_address_unqualified(), get_role_oid_or_public(), get_rolespec_oid(), GrantRole(), is_member(), pg_has_role_id_name(), pg_has_role_name(), pg_has_role_name_id(), pg_has_role_name_name(), regrolein(), shell_check_detail(), and worker_spi_launch().
Oid get_role_oid_or_public | ( | const char * | rolname | ) |
Definition at line 5438 of file acl.c.
References ACL_ID_PUBLIC, get_role_oid(), and rolname.
Referenced by has_any_column_privilege_name_id(), has_any_column_privilege_name_name(), has_column_privilege_name_id_attnum(), has_column_privilege_name_id_name(), has_column_privilege_name_name_attnum(), has_column_privilege_name_name_name(), has_database_privilege_name_id(), has_database_privilege_name_name(), has_foreign_data_wrapper_privilege_name_id(), has_foreign_data_wrapper_privilege_name_name(), has_function_privilege_name_id(), has_function_privilege_name_name(), has_language_privilege_name_id(), has_language_privilege_name_name(), has_parameter_privilege_name_name(), has_schema_privilege_name_id(), has_schema_privilege_name_name(), has_sequence_privilege_name_id(), has_sequence_privilege_name_name(), has_server_privilege_name_id(), has_server_privilege_name_name(), has_table_privilege_name_id(), has_table_privilege_name_name(), has_tablespace_privilege_name_id(), has_tablespace_privilege_name_name(), has_type_privilege_name_id(), and has_type_privilege_name_name().
char* get_rolespec_name | ( | const RoleSpec * | role | ) |
Definition at line 5539 of file acl.c.
References get_rolespec_tuple(), GETSTRUCT, NameStr, pstrdup(), and ReleaseSysCache().
Referenced by AddRoleMems(), and DelRoleMems().
Definition at line 5454 of file acl.c.
References Assert, elog, ereport, errcode(), errmsg(), ERROR, get_role_oid(), GetSessionUserId(), GetUserId(), InvalidOid, RoleSpec::rolename, ROLESPEC_CSTRING, ROLESPEC_CURRENT_ROLE, ROLESPEC_CURRENT_USER, ROLESPEC_PUBLIC, ROLESPEC_SESSION_USER, and RoleSpec::roletype.
Referenced by AlterUserMapping(), ATExecCmd(), CreateSchemaCommand(), CreateTableSpace(), CreateUserMapping(), ExecAlterDefaultPrivilegesStmt(), ExecAlterOwnerStmt(), ExecuteGrantStmt(), GrantRole(), policy_role_list_to_array(), ReassignOwnedObjects(), RemoveUserMapping(), and roleSpecsToIds().
Definition at line 5493 of file acl.c.
References Assert, CStringGetDatum(), elog, ereport, errcode(), errmsg(), ERROR, GetSessionUserId(), GetUserId(), HeapTupleIsValid, ObjectIdGetDatum(), RoleSpec::rolename, ROLESPEC_CSTRING, ROLESPEC_CURRENT_ROLE, ROLESPEC_CURRENT_USER, ROLESPEC_PUBLIC, ROLESPEC_SESSION_USER, RoleSpec::roletype, and SearchSysCache1().
Referenced by AlterRole(), AlterRoleSet(), CreateRole(), and get_rolespec_name().
|
static |
Definition at line 149 of file acl.c.
References Assert, ereturn, errcode(), errdetail(), errmsg(), len, and NAMEDATALEN.
Referenced by aclparse().
Datum has_any_column_privilege_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2410 of file acl.c.
References ACLCHECK_OK, ACLMASK_ANY, convert_column_priv_string(), GetUserId(), mode, pg_attribute_aclcheck_all_ext(), pg_class_aclcheck_ext(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_any_column_privilege_id_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2470 of file acl.c.
References ACLCHECK_OK, ACLMASK_ANY, convert_column_priv_string(), mode, pg_attribute_aclcheck_all_ext(), pg_class_aclcheck_ext(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_any_column_privilege_id_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2443 of file acl.c.
References ACLCHECK_OK, ACLMASK_ANY, convert_column_priv_string(), convert_table_name(), mode, pg_attribute_aclcheck_all(), pg_class_aclcheck(), PG_GETARG_OID, PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_any_column_privilege_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2347 of file acl.c.
References ACLCHECK_OK, ACLMASK_ANY, convert_column_priv_string(), convert_table_name(), GetUserId(), mode, pg_attribute_aclcheck_all(), pg_class_aclcheck(), PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_any_column_privilege_name_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2375 of file acl.c.
References ACLCHECK_OK, ACLMASK_ANY, convert_column_priv_string(), get_role_oid_or_public(), mode, NameStr, pg_attribute_aclcheck_all_ext(), pg_class_aclcheck_ext(), PG_GETARG_NAME, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, PG_RETURN_NULL, and username.
Datum has_any_column_privilege_name_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2317 of file acl.c.
References ACLCHECK_OK, ACLMASK_ANY, convert_column_priv_string(), convert_table_name(), get_role_oid_or_public(), mode, NameStr, pg_attribute_aclcheck_all(), pg_class_aclcheck(), PG_GETARG_NAME, PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_column_privilege_id_attnum | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2853 of file acl.c.
References column_privilege_check(), convert_column_priv_string(), GetUserId(), mode, PG_GETARG_INT16, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_column_privilege_id_id_attnum | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2746 of file acl.c.
References column_privilege_check(), convert_column_priv_string(), mode, PG_GETARG_INT16, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_column_privilege_id_id_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2721 of file acl.c.
References column_privilege_check(), convert_column_name(), convert_column_priv_string(), mode, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_column_privilege_id_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2826 of file acl.c.
References column_privilege_check(), convert_column_name(), convert_column_priv_string(), GetUserId(), mode, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_column_privilege_id_name_attnum | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2696 of file acl.c.
References column_privilege_check(), convert_column_priv_string(), convert_table_name(), mode, PG_GETARG_INT16, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_column_privilege_id_name_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2669 of file acl.c.
References column_privilege_check(), convert_column_name(), convert_column_priv_string(), convert_table_name(), mode, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_column_privilege_name_attnum | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2799 of file acl.c.
References column_privilege_check(), convert_column_priv_string(), convert_table_name(), GetUserId(), mode, PG_GETARG_INT16, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_column_privilege_name_id_attnum | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2644 of file acl.c.
References column_privilege_check(), convert_column_priv_string(), get_role_oid_or_public(), mode, NameStr, PG_GETARG_INT16, PG_GETARG_NAME, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, PG_RETURN_NULL, and username.
Datum has_column_privilege_name_id_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2617 of file acl.c.
References column_privilege_check(), convert_column_name(), convert_column_priv_string(), get_role_oid_or_public(), mode, NameStr, PG_GETARG_NAME, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, PG_RETURN_NULL, and username.
Datum has_column_privilege_name_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2770 of file acl.c.
References column_privilege_check(), convert_column_name(), convert_column_priv_string(), convert_table_name(), GetUserId(), mode, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_column_privilege_name_name_attnum | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2590 of file acl.c.
References column_privilege_check(), convert_column_priv_string(), convert_table_name(), get_role_oid_or_public(), mode, NameStr, PG_GETARG_INT16, PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_column_privilege_name_name_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2561 of file acl.c.
References column_privilege_check(), convert_column_name(), convert_column_priv_string(), convert_table_name(), get_role_oid_or_public(), mode, NameStr, PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_database_privilege_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3053 of file acl.c.
References ACLCHECK_OK, convert_database_priv_string(), GetUserId(), mode, object_aclcheck_ext(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_database_privilege_id_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3104 of file acl.c.
References ACLCHECK_OK, convert_database_priv_string(), mode, object_aclcheck_ext(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_database_privilege_id_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3081 of file acl.c.
References ACLCHECK_OK, convert_database_name(), convert_database_priv_string(), mode, object_aclcheck(), PG_GETARG_OID, PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_database_privilege_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2999 of file acl.c.
References ACLCHECK_OK, convert_database_name(), convert_database_priv_string(), GetUserId(), mode, object_aclcheck(), PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_database_privilege_name_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3023 of file acl.c.
References ACLCHECK_OK, convert_database_priv_string(), get_role_oid_or_public(), mode, NameStr, object_aclcheck_ext(), PG_GETARG_NAME, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, PG_RETURN_NULL, and username.
Datum has_database_privilege_name_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2973 of file acl.c.
References ACLCHECK_OK, convert_database_name(), convert_database_priv_string(), get_role_oid_or_public(), mode, NameStr, object_aclcheck(), PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and username.
Datum has_foreign_data_wrapper_privilege_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3259 of file acl.c.
References ACLCHECK_OK, convert_foreign_data_wrapper_priv_string(), GetUserId(), mode, object_aclcheck_ext(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_foreign_data_wrapper_privilege_id_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3310 of file acl.c.
References ACLCHECK_OK, convert_foreign_data_wrapper_priv_string(), mode, object_aclcheck_ext(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_foreign_data_wrapper_privilege_id_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3287 of file acl.c.
References ACLCHECK_OK, convert_foreign_data_wrapper_name(), convert_foreign_data_wrapper_priv_string(), mode, object_aclcheck(), PG_GETARG_OID, PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_foreign_data_wrapper_privilege_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3205 of file acl.c.
References ACLCHECK_OK, convert_foreign_data_wrapper_name(), convert_foreign_data_wrapper_priv_string(), GetUserId(), mode, object_aclcheck(), PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_foreign_data_wrapper_privilege_name_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3229 of file acl.c.
References ACLCHECK_OK, convert_foreign_data_wrapper_priv_string(), get_role_oid_or_public(), mode, NameStr, object_aclcheck_ext(), PG_GETARG_NAME, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, PG_RETURN_NULL, and username.
Datum has_foreign_data_wrapper_privilege_name_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3179 of file acl.c.
References ACLCHECK_OK, convert_foreign_data_wrapper_name(), convert_foreign_data_wrapper_priv_string(), get_role_oid_or_public(), mode, NameStr, object_aclcheck(), PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and username.
Datum has_function_privilege_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3459 of file acl.c.
References ACLCHECK_OK, convert_function_priv_string(), GetUserId(), mode, object_aclcheck_ext(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_function_privilege_id_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3510 of file acl.c.
References ACLCHECK_OK, convert_function_priv_string(), mode, object_aclcheck_ext(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_function_privilege_id_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3487 of file acl.c.
References ACLCHECK_OK, convert_function_name(), convert_function_priv_string(), mode, object_aclcheck(), PG_GETARG_OID, PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_function_privilege_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3405 of file acl.c.
References ACLCHECK_OK, convert_function_name(), convert_function_priv_string(), GetUserId(), mode, object_aclcheck(), PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_function_privilege_name_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3429 of file acl.c.
References ACLCHECK_OK, convert_function_priv_string(), get_role_oid_or_public(), mode, NameStr, object_aclcheck_ext(), PG_GETARG_NAME, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, PG_RETURN_NULL, and username.
Datum has_function_privilege_name_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3379 of file acl.c.
References ACLCHECK_OK, convert_function_name(), convert_function_priv_string(), get_role_oid_or_public(), mode, NameStr, object_aclcheck(), PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and username.
Datum has_language_privilege_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3668 of file acl.c.
References ACLCHECK_OK, convert_language_priv_string(), GetUserId(), mode, object_aclcheck_ext(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_language_privilege_id_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3719 of file acl.c.
References ACLCHECK_OK, convert_language_priv_string(), mode, object_aclcheck_ext(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_language_privilege_id_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3696 of file acl.c.
References ACLCHECK_OK, convert_language_name(), convert_language_priv_string(), mode, object_aclcheck(), PG_GETARG_OID, PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_language_privilege_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3614 of file acl.c.
References ACLCHECK_OK, convert_language_name(), convert_language_priv_string(), GetUserId(), mode, object_aclcheck(), PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_language_privilege_name_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3638 of file acl.c.
References ACLCHECK_OK, convert_language_priv_string(), get_role_oid_or_public(), mode, NameStr, object_aclcheck_ext(), PG_GETARG_NAME, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, PG_RETURN_NULL, and username.
Datum has_language_privilege_name_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3588 of file acl.c.
References ACLCHECK_OK, convert_language_name(), convert_language_priv_string(), get_role_oid_or_public(), mode, NameStr, object_aclcheck(), PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and username.
Definition at line 4598 of file acl.c.
References ACLCHECK_OK, pg_parameter_aclcheck(), and text_to_cstring().
Referenced by has_parameter_privilege_id_name(), has_parameter_privilege_name(), and has_parameter_privilege_name_name().
Datum has_parameter_privilege_id_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4641 of file acl.c.
References convert_parameter_priv_string(), has_param_priv_byname(), PG_GETARG_OID, PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_parameter_privilege_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4627 of file acl.c.
References convert_parameter_priv_string(), GetUserId(), has_param_priv_byname(), PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_parameter_privilege_name_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4611 of file acl.c.
References convert_parameter_priv_string(), get_role_oid_or_public(), has_param_priv_byname(), NameStr, PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and username.
Definition at line 5134 of file acl.c.
References InvalidOid, list_member_oid(), ROLERECURSE_PRIVS, roles_is_member_of(), and superuser_arg().
Referenced by aclmask(), AlterObjectNamespace_internal(), AlterObjectOwner_internal(), AlterObjectRename_internal(), bbsink_server_new(), calculate_database_size(), calculate_tablespace_size(), check_role_for_policy(), check_role_grantor(), ConfigOptionIsVisible(), convert_and_check_filename(), CreateSubscription(), DoCopy(), DropOwnedObjects(), ExecAlterDefaultPrivilegesStmt(), file_fdw_validator(), GetConfigOptionValues(), InitPostgres(), object_ownercheck(), pg_class_aclmask_ext(), pg_namespace_aclmask_ext(), pg_role_aclcheck(), pg_signal_backend(), pg_stat_get_wal_receiver(), pg_stat_get_wal_senders(), pg_stat_statements_internal(), pgrowlocks(), ReassignOwnedObjects(), ReindexMultipleTables(), shell_check_detail(), standard_ProcessUtility(), and TerminateOtherDBBackends().
Datum has_schema_privilege_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3868 of file acl.c.
References ACLCHECK_OK, convert_schema_priv_string(), GetUserId(), mode, object_aclcheck_ext(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_schema_privilege_id_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3919 of file acl.c.
References ACLCHECK_OK, convert_schema_priv_string(), mode, object_aclcheck_ext(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_schema_privilege_id_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3896 of file acl.c.
References ACLCHECK_OK, convert_schema_name(), convert_schema_priv_string(), mode, object_aclcheck(), PG_GETARG_OID, PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_schema_privilege_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3814 of file acl.c.
References ACLCHECK_OK, convert_schema_name(), convert_schema_priv_string(), GetUserId(), mode, object_aclcheck(), PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_schema_privilege_name_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3838 of file acl.c.
References ACLCHECK_OK, convert_schema_priv_string(), get_role_oid_or_public(), mode, NameStr, object_aclcheck_ext(), PG_GETARG_NAME, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, PG_RETURN_NULL, and username.
Datum has_schema_privilege_name_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3788 of file acl.c.
References ACLCHECK_OK, convert_schema_name(), convert_schema_priv_string(), get_role_oid_or_public(), mode, NameStr, object_aclcheck(), PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and username.
Datum has_sequence_privilege_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2188 of file acl.c.
References ACLCHECK_OK, convert_sequence_priv_string(), ereport, errcode(), errmsg(), ERROR, get_rel_name(), get_rel_relkind(), GetUserId(), mode, pg_class_aclcheck_ext(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_sequence_privilege_id_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2251 of file acl.c.
References ACLCHECK_OK, convert_sequence_priv_string(), ereport, errcode(), errmsg(), ERROR, get_rel_name(), get_rel_relkind(), mode, pg_class_aclcheck_ext(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_sequence_privilege_id_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2223 of file acl.c.
References ACLCHECK_OK, convert_sequence_priv_string(), convert_table_name(), ereport, errcode(), errmsg(), ERROR, get_rel_relkind(), mode, pg_class_aclcheck(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and text_to_cstring().
Datum has_sequence_privilege_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2122 of file acl.c.
References ACLCHECK_OK, convert_sequence_priv_string(), convert_table_name(), ereport, errcode(), errmsg(), ERROR, get_rel_relkind(), GetUserId(), mode, pg_class_aclcheck(), PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and text_to_cstring().
Datum has_sequence_privilege_name_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2151 of file acl.c.
References ACLCHECK_OK, convert_sequence_priv_string(), ereport, errcode(), errmsg(), ERROR, get_rel_name(), get_rel_relkind(), get_role_oid_or_public(), mode, NameStr, pg_class_aclcheck_ext(), PG_GETARG_NAME, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, PG_RETURN_NULL, and username.
Datum has_sequence_privilege_name_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2091 of file acl.c.
References ACLCHECK_OK, convert_sequence_priv_string(), convert_table_name(), ereport, errcode(), errmsg(), ERROR, get_rel_relkind(), get_role_oid_or_public(), mode, NameStr, pg_class_aclcheck(), PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and text_to_cstring().
Datum has_server_privilege_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4070 of file acl.c.
References ACLCHECK_OK, convert_server_priv_string(), GetUserId(), mode, object_aclcheck_ext(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_server_privilege_id_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4121 of file acl.c.
References ACLCHECK_OK, convert_server_priv_string(), mode, object_aclcheck_ext(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_server_privilege_id_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4098 of file acl.c.
References ACLCHECK_OK, convert_server_name(), convert_server_priv_string(), mode, object_aclcheck(), PG_GETARG_OID, PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_server_privilege_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4016 of file acl.c.
References ACLCHECK_OK, convert_server_name(), convert_server_priv_string(), GetUserId(), mode, object_aclcheck(), PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_server_privilege_name_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4040 of file acl.c.
References ACLCHECK_OK, convert_server_priv_string(), get_role_oid_or_public(), mode, NameStr, object_aclcheck_ext(), PG_GETARG_NAME, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, PG_RETURN_NULL, and username.
Datum has_server_privilege_name_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3990 of file acl.c.
References ACLCHECK_OK, convert_server_name(), convert_server_priv_string(), get_role_oid_or_public(), mode, NameStr, object_aclcheck(), PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and username.
Datum has_table_privilege_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1956 of file acl.c.
References ACLCHECK_OK, convert_table_priv_string(), GetUserId(), mode, pg_class_aclcheck_ext(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_table_privilege_id_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2005 of file acl.c.
References ACLCHECK_OK, convert_table_priv_string(), mode, pg_class_aclcheck_ext(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_table_privilege_id_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1982 of file acl.c.
References ACLCHECK_OK, convert_table_name(), convert_table_priv_string(), mode, pg_class_aclcheck(), PG_GETARG_OID, PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_table_privilege_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1904 of file acl.c.
References ACLCHECK_OK, convert_table_name(), convert_table_priv_string(), GetUserId(), mode, pg_class_aclcheck(), PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_table_privilege_name_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1928 of file acl.c.
References ACLCHECK_OK, convert_table_priv_string(), get_role_oid_or_public(), mode, NameStr, pg_class_aclcheck_ext(), PG_GETARG_NAME, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, PG_RETURN_NULL, and username.
Datum has_table_privilege_name_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1878 of file acl.c.
References ACLCHECK_OK, convert_table_name(), convert_table_priv_string(), get_role_oid_or_public(), mode, NameStr, pg_class_aclcheck(), PG_GETARG_NAME, PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_tablespace_privilege_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4270 of file acl.c.
References ACLCHECK_OK, convert_tablespace_priv_string(), GetUserId(), mode, object_aclcheck_ext(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_tablespace_privilege_id_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4321 of file acl.c.
References ACLCHECK_OK, convert_tablespace_priv_string(), mode, object_aclcheck_ext(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_tablespace_privilege_id_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4298 of file acl.c.
References ACLCHECK_OK, convert_tablespace_name(), convert_tablespace_priv_string(), mode, object_aclcheck(), PG_GETARG_OID, PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_tablespace_privilege_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4216 of file acl.c.
References ACLCHECK_OK, convert_tablespace_name(), convert_tablespace_priv_string(), GetUserId(), mode, object_aclcheck(), PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_tablespace_privilege_name_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4240 of file acl.c.
References ACLCHECK_OK, convert_tablespace_priv_string(), get_role_oid_or_public(), mode, NameStr, object_aclcheck_ext(), PG_GETARG_NAME, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, PG_RETURN_NULL, and username.
Datum has_tablespace_privilege_name_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4190 of file acl.c.
References ACLCHECK_OK, convert_tablespace_name(), convert_tablespace_priv_string(), get_role_oid_or_public(), mode, NameStr, object_aclcheck(), PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and username.
Datum has_type_privilege_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4469 of file acl.c.
References ACLCHECK_OK, convert_type_priv_string(), GetUserId(), mode, object_aclcheck_ext(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_type_privilege_id_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4520 of file acl.c.
References ACLCHECK_OK, convert_type_priv_string(), mode, object_aclcheck_ext(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum has_type_privilege_id_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4497 of file acl.c.
References ACLCHECK_OK, convert_type_name(), convert_type_priv_string(), mode, object_aclcheck(), PG_GETARG_OID, PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_type_privilege_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4415 of file acl.c.
References ACLCHECK_OK, convert_type_name(), convert_type_priv_string(), GetUserId(), mode, object_aclcheck(), PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum has_type_privilege_name_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4439 of file acl.c.
References ACLCHECK_OK, convert_type_priv_string(), get_role_oid_or_public(), mode, NameStr, object_aclcheck_ext(), PG_GETARG_NAME, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, PG_RETURN_NULL, and username.
Datum has_type_privilege_name_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4389 of file acl.c.
References ACLCHECK_OK, convert_type_name(), convert_type_priv_string(), get_role_oid_or_public(), mode, NameStr, object_aclcheck(), PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and username.
Datum hash_aclitem | ( | PG_FUNCTION_ARGS | ) |
Datum hash_aclitem_extended | ( | PG_FUNCTION_ARGS | ) |
Definition at line 765 of file acl.c.
References a, hash_uint32_extended(), PG_GETARG_ACLITEM_P, PG_GETARG_INT64, and UInt64GetDatum().
void initialize_acl | ( | void | ) |
Definition at line 4890 of file acl.c.
References cached_db_hash, CacheRegisterSyscacheCallback(), GetSysCacheHashValue1, IsBootstrapProcessingMode, MyDatabaseId, ObjectIdGetDatum(), and RoleMembershipCacheCallback().
Referenced by InitPostgres().
Definition at line 5264 of file acl.c.
References OidIsValid, ROLERECURSE_MEMBERS, roles_is_member_of(), and superuser_arg().
Referenced by AlterRole(), AlterRoleSet(), check_object_ownership(), check_role_membership_authorization(), DropRole(), pg_role_aclcheck(), and RenameRole().
Definition at line 5214 of file acl.c.
References InvalidOid, list_member_oid(), ROLERECURSE_MEMBERS, roles_is_member_of(), and superuser_arg().
Referenced by pg_role_aclcheck().
Definition at line 5242 of file acl.c.
References InvalidOid, list_member_oid(), ROLERECURSE_MEMBERS, and roles_is_member_of().
Referenced by AddRoleMems(), and is_member().
Acl* make_empty_acl | ( | void | ) |
Datum makeaclitem | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1617 of file acl.c.
References ACL_ALTER_SYSTEM, ACL_CONNECT, ACL_CREATE, ACL_CREATE_TEMP, ACL_DELETE, ACL_EXECUTE, ACL_INSERT, ACL_MAINTAIN, ACL_NO_RIGHTS, ACL_REFERENCES, ACL_SELECT, ACL_SET, ACL_TRIGGER, ACL_TRUNCATE, ACL_UPDATE, ACL_USAGE, ACLITEM_SET_PRIVS_GOPTIONS, AclItem::ai_grantee, AclItem::ai_grantor, convert_any_priv_string(), palloc(), PG_GETARG_BOOL, PG_GETARG_OID, PG_GETARG_TEXT_PP, and PG_RETURN_ACLITEM_P.
Definition at line 5168 of file acl.c.
References InvalidOid, list_member_oid(), ROLERECURSE_SETROLE, roles_is_member_of(), and superuser_arg().
Referenced by check_can_set_role(), check_role(), pg_role_aclcheck(), and SwitchToUntrustedUser().
Datum pg_has_role_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4762 of file acl.c.
References ACLCHECK_OK, convert_role_priv_string(), GetUserId(), mode, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and pg_role_aclcheck().
Datum pg_has_role_id_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4807 of file acl.c.
References ACLCHECK_OK, convert_role_priv_string(), mode, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and pg_role_aclcheck().
Datum pg_has_role_id_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4784 of file acl.c.
References ACLCHECK_OK, convert_role_priv_string(), get_role_oid(), mode, NameStr, PG_GETARG_NAME, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and pg_role_aclcheck().
Datum pg_has_role_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4714 of file acl.c.
References ACLCHECK_OK, convert_role_priv_string(), get_role_oid(), GetUserId(), mode, NameStr, PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and pg_role_aclcheck().
Datum pg_has_role_name_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4738 of file acl.c.
References ACLCHECK_OK, convert_role_priv_string(), get_role_oid(), mode, NameStr, PG_GETARG_NAME, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, pg_role_aclcheck(), and username.
Datum pg_has_role_name_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4688 of file acl.c.
References ACLCHECK_OK, convert_role_priv_string(), get_role_oid(), mode, NameStr, PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, pg_role_aclcheck(), and username.
Definition at line 4860 of file acl.c.
References ACL_CREATE, ACL_GRANT_OPTION_FOR, ACL_SET, ACL_USAGE, ACLCHECK_NO_PRIV, ACLCHECK_OK, has_privs_of_role(), is_admin_of_role(), is_member_of_role(), member_can_set_role(), and mode.
Referenced by pg_has_role_id(), pg_has_role_id_id(), pg_has_role_id_name(), pg_has_role_name(), pg_has_role_name_id(), and pg_has_role_name_name().
|
static |
|
static |
Definition at line 1285 of file acl.c.
References ACL_DAT, ACL_GRANT_OPTION_FOR, ACL_MODECHG_DEL, ACL_NO_RIGHTS, ACL_NUM, ACL_OPTION_TO_PRIVS, ACLITEM_GET_PRIVS, ACLITEM_SET_PRIVS_GOPTIONS, aclmask(), ACLMASK_ALL, aclupdate(), AclItem::ai_grantee, AclItem::ai_grantor, check_acl(), DROP_RESTRICT, ereport, errcode(), errhint(), errmsg(), ERROR, i, and pfree().
Referenced by aclupdate().
Definition at line 4920 of file acl.c.
References cached_db_hash, cached_role, InvalidOid, ROLERECURSE_MEMBERS, ROLERECURSE_PRIVS, and ROLERECURSE_SETROLE.
Referenced by initialize_acl().
|
static |
Definition at line 5002 of file acl.c.
References Assert, bloom_free(), cached_role, cached_roles, elog, ERROR, GETSTRUCT, HeapTupleIsValid, i, InvalidOid, lfirst_oid, list_copy(), list_free(), list_make1_oid, catclist::members, MemoryContextSwitchTo(), MyDatabaseId, catclist::n_members, ObjectIdGetDatum(), OidIsValid, PointerIsValid, ReleaseSysCache(), ReleaseSysCacheList, ROLERECURSE_PRIVS, ROLERECURSE_SETROLE, roles_list_append(), SearchSysCache1(), SearchSysCacheList1, TopMemoryContext, catctup::tuple, and type.
Referenced by has_privs_of_role(), is_admin_of_role(), is_member_of_role(), is_member_of_role_nosuper(), member_can_set_role(), select_best_admin(), and select_best_grantor().
|
inlinestatic |
Definition at line 4942 of file acl.c.
References bloom_add_element(), bloom_create(), bloom_lacks_element(), foreach_oid, lappend_oid(), list_length(), list_member_oid(), ROLES_LIST_BLOOM_THRESHOLD, and work_mem.
Referenced by roles_is_member_of().
Definition at line 5289 of file acl.c.
References InvalidOid, ROLERECURSE_PRIVS, and roles_is_member_of().
Referenced by check_role_grantor().
void select_best_grantor | ( | Oid | roleId, |
AclMode | privileges, | ||
const Acl * | acl, | ||
Oid | ownerId, | ||
Oid * | grantorId, | ||
AclMode * | grantOptions | ||
) |
Definition at line 5344 of file acl.c.
References ACL_GRANT_OPTION_FOR, ACL_NO_RIGHTS, ACLMASK_ALL, aclmask_direct(), count_one_bits(), InvalidOid, lfirst_oid, ROLERECURSE_PRIVS, roles_is_member_of(), and superuser_arg().
Referenced by ExecGrant_Attribute(), ExecGrant_common(), ExecGrant_Largeobject(), ExecGrant_Parameter(), and ExecGrant_Relation().
|
static |
Definition at line 80 of file acl.c.
Referenced by initialize_acl(), and RoleMembershipCacheCallback().
|
static |
Definition at line 78 of file acl.c.
Referenced by RoleMembershipCacheCallback(), and roles_is_member_of().