mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Do not treat a superuser as a member of every role for HBA purposes.
This makes it possible to use reject lines with group roles. Andrew Dunstan, reviewd by Robert Haas.
This commit is contained in:
@ -442,8 +442,13 @@ is_member(Oid userid, const char *role)
|
||||
if (!OidIsValid(roleid))
|
||||
return false; /* if target role not exist, say "no" */
|
||||
|
||||
/* See if user is directly or indirectly a member of role */
|
||||
return is_member_of_role(userid, roleid);
|
||||
/*
|
||||
* See if user is directly or indirectly a member of role.
|
||||
* For this purpose, a superuser is not considered to be automatically
|
||||
* a member of the role, so group auth only applies to explicit
|
||||
* membership.
|
||||
*/
|
||||
return is_member_of_role_nosuper(userid, roleid);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user