File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,6 @@ typedef struct
51
51
* role. In most of these tests the "given role" is the same, namely the
52
52
* active current user. So we can optimize it by keeping a cached list of
53
53
* all the roles the "given role" is a member of, directly or indirectly.
54
- * The cache is flushed whenever we detect a change in pg_auth_members.
55
54
*
56
55
* There are actually two caches, one computed under "has_privs" rules
57
56
* (do not recurse where rolinherit isn't true) and one computed under
@@ -4690,12 +4689,16 @@ initialize_acl(void)
4690
4689
if (!IsBootstrapProcessingMode ())
4691
4690
{
4692
4691
/*
4693
- * In normal mode, set a callback on any syscache invalidation of
4694
- * pg_auth_members rows
4692
+ * In normal mode, set a callback on any syscache invalidation of rows
4693
+ * of pg_auth_members (for each AUTHMEM search in this file) or
4694
+ * pg_authid (for has_rolinherit())
4695
4695
*/
4696
4696
CacheRegisterSyscacheCallback (AUTHMEMROLEMEM ,
4697
4697
RoleMembershipCacheCallback ,
4698
4698
(Datum ) 0 );
4699
+ CacheRegisterSyscacheCallback (AUTHOID ,
4700
+ RoleMembershipCacheCallback ,
4701
+ (Datum ) 0 );
4699
4702
}
4700
4703
}
4701
4704
Original file line number Diff line number Diff line change @@ -346,6 +346,13 @@ SET SESSION AUTHORIZATION regress_priv_user1;
346
346
SELECT * FROM atest3; -- fail
347
347
ERROR: permission denied for table atest3
348
348
DELETE FROM atest3; -- ok
349
+ BEGIN;
350
+ RESET SESSION AUTHORIZATION;
351
+ ALTER ROLE regress_priv_user1 NOINHERIT;
352
+ SET SESSION AUTHORIZATION regress_priv_user1;
353
+ DELETE FROM atest3;
354
+ ERROR: permission denied for table atest3
355
+ ROLLBACK;
349
356
-- views
350
357
SET SESSION AUTHORIZATION regress_priv_user3;
351
358
CREATE VIEW atestv1 AS SELECT * FROM atest1; -- ok
Original file line number Diff line number Diff line change @@ -216,6 +216,12 @@ SET SESSION AUTHORIZATION regress_priv_user1;
216
216
SELECT * FROM atest3; -- fail
217
217
DELETE FROM atest3; -- ok
218
218
219
+ BEGIN ;
220
+ RESET SESSION AUTHORIZATION;
221
+ ALTER ROLE regress_priv_user1 NOINHERIT;
222
+ SET SESSION AUTHORIZATION regress_priv_user1;
223
+ DELETE FROM atest3;
224
+ ROLLBACK ;
219
225
220
226
-- views
221
227
You can’t perform that action at this time.
0 commit comments