8
8
*
9
9
*
10
10
* 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 $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -345,7 +345,7 @@ pg_krb5_recvauth(Port *port)
345
345
static void
346
346
auth_failed (Port * port , int status )
347
347
{
348
- const char * authmethod = "Unknown auth method:" ;
348
+ const char * errstr ;
349
349
350
350
/*
351
351
* 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)
363
363
switch (port -> auth_method )
364
364
{
365
365
case uaReject :
366
- authmethod = "Rejected host:" ;
366
+ errstr = gettext ( "Rejected host: authentication failed for user \"%s\"" ) ;
367
367
break ;
368
368
case uaKrb4 :
369
- authmethod = "Kerberos4" ;
369
+ errstr = gettext ( "Kerberos4 authentication failed for user \"%s\"" ) ;
370
370
break ;
371
371
case uaKrb5 :
372
- authmethod = "Kerberos5" ;
372
+ errstr = gettext ( "Kerberos5 authentication failed for user \"%s\"" ) ;
373
373
break ;
374
374
case uaTrust :
375
- authmethod = "Trusted" ;
375
+ errstr = gettext ( "Trusted authentication failed for user \"%s\"" ) ;
376
376
break ;
377
377
case uaIdent :
378
- authmethod = "IDENT" ;
378
+ errstr = gettext ( "IDENT authentication failed for user \"%s\"" ) ;
379
379
break ;
380
380
case uaMD5 :
381
381
case uaCrypt :
382
382
case uaPassword :
383
- authmethod = "Password" ;
383
+ errstr = gettext ( "Password authentication failed for user \"%s\"" ) ;
384
384
break ;
385
385
#ifdef USE_PAM
386
386
case uaPAM :
387
- authmethod = "PAM" ;
387
+ errstr = gettext ( "PAM authentication failed for user \"%s\"" ) ;
388
388
break ;
389
389
#endif /* USE_PAM */
390
+ default :
391
+ errstr = gettext ("Unknown auth method: authentication failed for user \"%s\"" );
392
+ break ;
390
393
}
391
394
392
395
ereport (FATAL ,
393
396
(errcode (ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION ),
394
- errmsg ("%s authentication failed for user \"%s\"" ,
395
- authmethod , port -> user_name )));
397
+ errmsg (errstr , port -> user_name )));
396
398
/* doesn't return */
397
399
}
398
400
0 commit comments