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.
This commit is contained in:
Tom Lane 2010-03-24 17:05:51 +00:00
parent e679564e90
commit 505efe9917

View File

@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.188.2.4 2010/03/08 09:57:35 mha Exp $ * $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.188.2.5 2010/03/24 17:05:51 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -1640,13 +1640,13 @@ ident_syntax:
/* /*
* Scan the (pre-parsed) ident usermap file line by line, looking for a match * Scan the (pre-parsed) ident usermap file line by line, looking for a match
* *
* See if the user with ident username "ident_user" is allowed to act * See if the user with ident username "auth_user" is allowed to act
* as Postgres user "pgrole" according to usermap "usermap_name". * as Postgres user "pg_role" according to usermap "usermap_name".
* *
* Special case: Usermap NULL, equivalent to what was previously called * Special case: Usermap NULL, equivalent to what was previously called
* "sameuser" or "samerole", don't look in the usermap * "sameuser" or "samerole", means don't look in the usermap file.
* file. That's an implied map where "pgrole" must be identical to * That's an implied map wherein "pg_role" must be identical to
* "ident_user" in order to be authorized. * "auth_user" in order to be authorized.
* *
* Iff authorized, return STATUS_OK, otherwise return STATUS_ERROR. * Iff authorized, return STATUS_OK, otherwise return STATUS_ERROR.
*/ */
@ -1673,7 +1673,7 @@ check_usermap(const char *usermap_name,
} }
ereport(LOG, ereport(LOG,
(errmsg("provided username (%s) and authenticated username (%s) don't match", (errmsg("provided username (%s) and authenticated username (%s) don't match",
auth_user, pg_role))); pg_role, auth_user)));
return STATUS_ERROR; return STATUS_ERROR;
} }
else else