diff options
Diffstat (limited to 'src/backend/libpq/auth.c')
-rw-r--r-- | src/backend/libpq/auth.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c index e6edef6b676..5396cc47c18 100644 --- a/src/backend/libpq/auth.c +++ b/src/backend/libpq/auth.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.97 2003/02/14 14:05:00 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.98 2003/04/17 22:26:01 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -29,7 +29,6 @@ #include "libpq/crypt.h" #include "libpq/hba.h" #include "libpq/libpq.h" -#include "libpq/password.h" #include "libpq/pqcomm.h" #include "libpq/pqformat.h" #include "miscadmin.h" @@ -378,7 +377,7 @@ auth_failed(Port *port, int status) } elog(FATAL, "%s authentication failed for user \"%s\"", - authmethod, port->user); + authmethod, port->user_name); /* doesn't return */ } @@ -427,7 +426,7 @@ ClientAuthentication(Port *port) elog(FATAL, "No pg_hba.conf entry for host %s, user %s, database %s", - hostinfo, port->user, port->database); + hostinfo, port->user_name, port->database_name); break; } @@ -638,10 +637,12 @@ CheckPAMAuth(Port *port, char *user, char *password) * not allocated */ /* Optionally, one can set the service name in pg_hba.conf */ - if (port->auth_arg[0] == '\0') - retval = pam_start(PGSQL_PAM_SERVICE, "pgsql@", &pam_passw_conv, &pamh); + if (port->auth_arg && port->auth_arg[0] != '\0') + retval = pam_start(port->auth_arg, "pgsql@", + &pam_passw_conv, &pamh); else - retval = pam_start(port->auth_arg, "pgsql@", &pam_passw_conv, &pamh); + retval = pam_start(PGSQL_PAM_SERVICE, "pgsql@", + &pam_passw_conv, &pamh); if (retval != PAM_SUCCESS) { @@ -741,7 +742,7 @@ recv_and_check_password_packet(Port *port) /* Do not echo password to logs, for security. */ elog(DEBUG5, "received password packet"); - result = md5_crypt_verify(port, port->user, buf.data); + result = md5_crypt_verify(port, port->user_name, buf.data); pfree(buf.data); return result; |