summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Davis2021-10-14 19:24:00 +0000
committerJeff Davis2021-10-14 19:24:00 +0000
commit7821a0bf2096df659671924fbeef0ebc66449292 (patch)
tree7a63abb3a528f7ff5670ac6b111d58d2baeed313
parent4d5f651f1d651c6fa79f9188e7b9a04654c7125a (diff)
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/[email protected] Backpatch-through: 9.6
-rw-r--r--src/backend/commands/seclabel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/commands/seclabel.c b/src/backend/commands/seclabel.c
index ddc019cb39a..308e0adb553 100644
--- a/src/backend/commands/seclabel.c
+++ b/src/backend/commands/seclabel.c
@@ -244,8 +244,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))