diff options
author | Jeff Davis <jdavis@postgresql.org> | 2021-10-14 12:25:07 -0700 |
---|---|---|
committer | Jeff Davis <jdavis@postgresql.org> | 2021-10-14 12:25:07 -0700 |
commit | ab11f6e461b9f2f4f6c4d812218a07af5d1c238d (patch) | |
tree | 4ce91ad9bf52ccd9bb87266c74f163c1737bee53 /src/backend | |
parent | 4b7abbe48a118e2b00f681e191da605e0d86b9c7 (diff) | |
download | postgresql-ab11f6e461b9f2f4f6c4d812218a07af5d1c238d.tar.gz postgresql-ab11f6e461b9f2f4f6c4d812218a07af5d1c238d.zip |
Check criticalSharedRelcachesBuilt in GetSharedSecurityLabel().
An extension may want to call GetSecurityLabel() on a shared object
before the shared relcaches are fully initialized. For instance, a
ClientAuthentication_hook might want to retrieve the security label on
a role.
Discussion: https://postgr.es/m/ecb7af0b26e3be1d96d291c8453a86f1f82d9061.camel@j-davis.com
Backpatch-through: 9.6
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/commands/seclabel.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/commands/seclabel.c b/src/backend/commands/seclabel.c index 9db82280287..c6fa7d0c07c 100644 --- a/src/backend/commands/seclabel.c +++ b/src/backend/commands/seclabel.c @@ -169,8 +169,8 @@ GetSharedSecurityLabel(const ObjectAddress *object, const char *provider) pg_shseclabel = table_open(SharedSecLabelRelationId, AccessShareLock); - scan = systable_beginscan(pg_shseclabel, SharedSecLabelObjectIndexId, true, - NULL, 3, keys); + scan = systable_beginscan(pg_shseclabel, SharedSecLabelObjectIndexId, + criticalSharedRelcachesBuilt, NULL, 3, keys); tuple = systable_getnext(scan); if (HeapTupleIsValid(tuple)) |