Skip to content

Commit ae6abeb

Browse files
committed
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
1 parent 5ec8761 commit ae6abeb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/commands/seclabel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ GetSharedSecurityLabel(const ObjectAddress *object, const char *provider)
168168

169169
pg_shseclabel = heap_open(SharedSecLabelRelationId, AccessShareLock);
170170

171-
scan = systable_beginscan(pg_shseclabel, SharedSecLabelObjectIndexId, true,
172-
NULL, 3, keys);
171+
scan = systable_beginscan(pg_shseclabel, SharedSecLabelObjectIndexId,
172+
criticalSharedRelcachesBuilt, NULL, 3, keys);
173173

174174
tuple = systable_getnext(scan);
175175
if (HeapTupleIsValid(tuple))

0 commit comments

Comments
 (0)