Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite530be2

Browse files
committed
Do not allow removal of superuser privileges from bootstrap user.
A bootstrap user who is not a superuser will still own manyimportant system objects, such as the pg_catalog schema, thatwill likely allow that user to regain superuser status. Therefore,allowing the superuser property to be removed from the superusercreates a false perception of security where none exists.Although removing superuser from the bootstrap user is also a bad ideaand should be considered unsupported in all released versions, noback-patch, as this is a behavior change.Discussion:http://postgr.es/m/CA+TgmoZirCwArJms_fgvLBFrC6b=HdxmG7iAhv+kt_=NBA7tEw@mail.gmail.com
1 parentf929441 commite530be2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎src/backend/commands/user.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,14 @@ AlterRole(ParseState *pstate, AlterRoleStmt *stmt)
693693
*/
694694
if (dissuper)
695695
{
696-
new_record[Anum_pg_authid_rolsuper-1]=BoolGetDatum(boolVal(dissuper->arg));
696+
boolshould_be_super=BoolGetDatum(boolVal(dissuper->arg));
697+
698+
if (!should_be_super&&roleid==BOOTSTRAP_SUPERUSERID)
699+
ereport(ERROR,
700+
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
701+
errmsg("permission denied: bootstrap user must be superuser")));
702+
703+
new_record[Anum_pg_authid_rolsuper-1]=should_be_super;
697704
new_record_repl[Anum_pg_authid_rolsuper-1]= true;
698705
}
699706

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp