88 *
99 *
1010 * IDENTIFICATION
11- * $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.114 2003/12/20 18:24:52 tgl Exp $
11+ * $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.115 2004/08/04 16:05:13 dennis Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -345,7 +345,7 @@ pg_krb5_recvauth(Port *port)
345345static void
346346auth_failed (Port * port ,int status )
347347{
348- const char * authmethod = "Unknown auth method:" ;
348+ const char * errstr ;
349349
350350/*
351351 * If we failed due to EOF from client, just quit; there's no point in
@@ -363,36 +363,38 @@ auth_failed(Port *port, int status)
363363switch (port -> auth_method )
364364{
365365case uaReject :
366- authmethod = "Rejected host:" ;
366+ errstr = gettext ( "Rejected host: authentication failed for user \"%s\"" ) ;
367367break ;
368368case uaKrb4 :
369- authmethod = "Kerberos4" ;
369+ errstr = gettext ( "Kerberos4 authentication failed for user \"%s\"" ) ;
370370break ;
371371case uaKrb5 :
372- authmethod = "Kerberos5" ;
372+ errstr = gettext ( "Kerberos5 authentication failed for user \"%s\"" ) ;
373373break ;
374374case uaTrust :
375- authmethod = "Trusted" ;
375+ errstr = gettext ( "Trusted authentication failed for user \"%s\"" ) ;
376376break ;
377377case uaIdent :
378- authmethod = "IDENT" ;
378+ errstr = gettext ( "IDENT authentication failed for user \"%s\"" ) ;
379379break ;
380380case uaMD5 :
381381case uaCrypt :
382382case uaPassword :
383- authmethod = "Password" ;
383+ errstr = gettext ( "Password authentication failed for user \"%s\"" ) ;
384384break ;
385385#ifdef USE_PAM
386386case uaPAM :
387- authmethod = "PAM" ;
387+ errstr = gettext ( "PAM authentication failed for user \"%s\"" ) ;
388388break ;
389389#endif /* USE_PAM */
390+ default :
391+ errstr = gettext ("Unknown auth method: authentication failed for user \"%s\"" );
392+ break ;
390393}
391394
392395ereport (FATAL ,
393396(errcode (ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION ),
394- errmsg ("%s authentication failed for user \"%s\"" ,
395- authmethod ,port -> user_name )));
397+ errmsg (errstr ,port -> user_name )));
396398/* doesn't return */
397399}
398400