mirror of https://github.com/citusdata/citus.git
Removes non-distributed grantor propagation
parent
0add3c273d
commit
2e4947428d
|
@ -884,8 +884,17 @@ GenerateGrantRoleStmtsOfRole(Oid roleid)
|
||||||
|
|
||||||
while (HeapTupleIsValid(tuple = systable_getnext(scan)))
|
while (HeapTupleIsValid(tuple = systable_getnext(scan)))
|
||||||
{
|
{
|
||||||
|
|
||||||
Form_pg_auth_members membership = (Form_pg_auth_members) GETSTRUCT(tuple);
|
Form_pg_auth_members membership = (Form_pg_auth_members) GETSTRUCT(tuple);
|
||||||
|
|
||||||
|
ObjectAddress *roleAddress = palloc0(sizeof(ObjectAddress));
|
||||||
|
ObjectAddressSet(*roleAddress, AuthIdRelationId, membership->grantor);
|
||||||
|
if (!IsAnyObjectDistributed(list_make1(roleAddress))){
|
||||||
|
|
||||||
|
/* we only need to propagate the grant if the grantor is distributed */
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
GrantRoleStmt *grantRoleStmt = makeNode(GrantRoleStmt);
|
GrantRoleStmt *grantRoleStmt = makeNode(GrantRoleStmt);
|
||||||
grantRoleStmt->is_grant = true;
|
grantRoleStmt->is_grant = true;
|
||||||
|
|
||||||
|
|
|
@ -304,9 +304,8 @@ SELECT rolname FROM pg_authid WHERE rolname LIKE '%dist\_%' ORDER BY 1;
|
||||||
SELECT roleid::regrole::text AS role, member::regrole::text, grantor::regrole::text, admin_option FROM pg_auth_members WHERE roleid::regrole::text LIKE '%dist\_%' ORDER BY 1, 2;
|
SELECT roleid::regrole::text AS role, member::regrole::text, grantor::regrole::text, admin_option FROM pg_auth_members WHERE roleid::regrole::text LIKE '%dist\_%' ORDER BY 1, 2;
|
||||||
role | member | grantor | admin_option
|
role | member | grantor | admin_option
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
dist_role_1 | dist_role_2 | postgres | f
|
|
||||||
non_dist_role_4 | dist_role_4 | postgres | f
|
non_dist_role_4 | dist_role_4 | postgres | f
|
||||||
(2 rows)
|
(1 row)
|
||||||
|
|
||||||
SELECT rolname FROM pg_authid WHERE rolname LIKE '%dist\_%' ORDER BY 1;
|
SELECT rolname FROM pg_authid WHERE rolname LIKE '%dist\_%' ORDER BY 1;
|
||||||
rolname
|
rolname
|
||||||
|
|
|
@ -119,6 +119,7 @@ GRANT dist_role_3 TO non_dist_role_3 granted by test_admin_role;
|
||||||
GRANT non_dist_role_4 TO dist_role_4;
|
GRANT non_dist_role_4 TO dist_role_4;
|
||||||
GRANT dist_role_3 TO dist_role_4 granted by test_admin_role;
|
GRANT dist_role_3 TO dist_role_4 granted by test_admin_role;
|
||||||
|
|
||||||
|
|
||||||
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
||||||
|
|
||||||
SELECT result FROM run_command_on_all_nodes(
|
SELECT result FROM run_command_on_all_nodes(
|
||||||
|
|
Loading…
Reference in New Issue