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

Commitfb631db

Browse files
committed
Include NOLOGIN roles in the 'flat' password file. In the original
coding this was seen as useless, but the problem with not including themis that the error message will often be something about authenticationfailure, rather than the more helpful one about 'role is not permittedto log in'. Per discussion.
1 parent7cf3ff1 commitfb631db

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

‎src/backend/utils/init/flatfiles.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
2424
* Portions Copyright (c) 1994, Regents of the University of California
2525
*
26-
* $PostgreSQL: pgsql/src/backend/utils/init/flatfiles.c,v 1.27 2007/08/01 22:45:08 tgl Exp $
26+
* $PostgreSQL: pgsql/src/backend/utils/init/flatfiles.c,v 1.28 2007/10/15 15:11:29 tgl Exp $
2727
*
2828
*-------------------------------------------------------------------------
2929
*/
@@ -298,7 +298,6 @@ write_database_file(Relation drel, bool startup)
298298
*
299299
* The format for the flat auth file is
300300
*"rolename" "password" "validuntil" "memberof" "memberof" ...
301-
* Only roles that are marked rolcanlogin are entered into the auth file.
302301
* Each role's line lists all the roles (groups) of which it is directly
303302
* or indirectly a member, except for itself.
304303
*
@@ -312,7 +311,6 @@ write_database_file(Relation drel, bool startup)
312311
typedefstruct
313312
{
314313
Oidroleid;
315-
boolrolcanlogin;
316314
char*rolname;
317315
char*rolpassword;
318316
char*rolvaliduntil;
@@ -407,8 +405,7 @@ write_auth_file(Relation rel_authid, Relation rel_authmem)
407405
tempname)));
408406

409407
/*
410-
* Read pg_authid and fill temporary data structures. Note we must read
411-
* all roles, even those without rolcanlogin.
408+
* Read pg_authid and fill temporary data structures.
412409
*/
413410
totalblocks=RelationGetNumberOfBlocks(rel_authid);
414411
totalblocks=totalblocks ?totalblocks :1;
@@ -433,7 +430,6 @@ write_auth_file(Relation rel_authid, Relation rel_authmem)
433430
}
434431

435432
auth_info[curr_role].roleid=HeapTupleGetOid(tuple);
436-
auth_info[curr_role].rolcanlogin=aform->rolcanlogin;
437433
auth_info[curr_role].rolname=pstrdup(NameStr(aform->rolname));
438434
auth_info[curr_role].member_of=NIL;
439435

@@ -565,10 +561,6 @@ write_auth_file(Relation rel_authid, Relation rel_authmem)
565561
List*roles_names_list=NIL;
566562
ListCell*mem;
567563

568-
/* We can skip this for non-login roles */
569-
if (!auth_info[curr_role].rolcanlogin)
570-
continue;
571-
572564
/*
573565
* This search algorithm is the same as in is_member_of_role; we
574566
* are just working with a different input data structure.
@@ -642,9 +634,6 @@ write_auth_file(Relation rel_authid, Relation rel_authmem)
642634
for (curr_role=0;curr_role<total_roles;curr_role++)
643635
{
644636
auth_entry*arole=&auth_info[curr_role];
645-
646-
if (arole->rolcanlogin)
647-
{
648637
ListCell*mem;
649638

650639
fputs_quote(arole->rolname,fp);
@@ -660,7 +649,6 @@ write_auth_file(Relation rel_authid, Relation rel_authmem)
660649
}
661650

662651
fputs("\n",fp);
663-
}
664652
}
665653

666654
if (FreeFile(fp))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp