Skip to content

Commit 16a4186

Browse files
committed
Fix thinko in log message for "sameuser" ident map mismatch: the provided
and authenticated usernames were swapped. Reported by Bryan Henderson in bug #5386. Also clean up poorly-maintained header comment for this function.
1 parent 223f82d commit 16a4186

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/backend/libpq/hba.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.203 2010/03/21 00:17:58 petere Exp $
13+
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.204 2010/03/24 17:05:45 tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -1715,13 +1715,13 @@ parse_ident_usermap(List *line, int line_number, const char *usermap_name,
17151715
/*
17161716
* Scan the (pre-parsed) ident usermap file line by line, looking for a match
17171717
*
1718-
* See if the user with ident username "ident_user" is allowed to act
1719-
* as Postgres user "pgrole" according to usermap "usermap_name".
1718+
* See if the user with ident username "auth_user" is allowed to act
1719+
* as Postgres user "pg_role" according to usermap "usermap_name".
17201720
*
17211721
* Special case: Usermap NULL, equivalent to what was previously called
1722-
* "sameuser" or "samerole", means don't look in the usermap
1723-
* file. That's an implied map where "pgrole" must be identical to
1724-
* "ident_user" in order to be authorized.
1722+
* "sameuser" or "samerole", means don't look in the usermap file.
1723+
* That's an implied map wherein "pg_role" must be identical to
1724+
* "auth_user" in order to be authorized.
17251725
*
17261726
* Iff authorized, return STATUS_OK, otherwise return STATUS_ERROR.
17271727
*/
@@ -1748,7 +1748,7 @@ check_usermap(const char *usermap_name,
17481748
}
17491749
ereport(LOG,
17501750
(errmsg("provided user name (%s) and authenticated user name (%s) do not match",
1751-
auth_user, pg_role)));
1751+
pg_role, auth_user)));
17521752
return STATUS_ERROR;
17531753
}
17541754
else

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy