Skip to content
Snippets Groups Projects
Commit c6d3158f authored by Dennis Bjorklund's avatar Dennis Bjorklund
Browse files

Add some strings for translation and remove some cut'n'paste

that makes it impossible to translate to other languages.
parent 020ec162
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.114 2003/12/20 18:24:52 tgl Exp $ * $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.115 2004/08/04 16:05:13 dennis Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -345,7 +345,7 @@ pg_krb5_recvauth(Port *port) ...@@ -345,7 +345,7 @@ pg_krb5_recvauth(Port *port)
static void static void
auth_failed(Port *port, int status) auth_failed(Port *port, int status)
{ {
const char *authmethod = "Unknown auth method:"; const char *errstr;
/* /*
* If we failed due to EOF from client, just quit; there's no point in * 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,36 +363,38 @@ auth_failed(Port *port, int status)
switch (port->auth_method) switch (port->auth_method)
{ {
case uaReject: case uaReject:
authmethod = "Rejected host:"; errstr = gettext("Rejected host: authentication failed for user \"%s\"");
break; break;
case uaKrb4: case uaKrb4:
authmethod = "Kerberos4"; errstr = gettext("Kerberos4 authentication failed for user \"%s\"");
break; break;
case uaKrb5: case uaKrb5:
authmethod = "Kerberos5"; errstr = gettext("Kerberos5 authentication failed for user \"%s\"");
break; break;
case uaTrust: case uaTrust:
authmethod = "Trusted"; errstr = gettext("Trusted authentication failed for user \"%s\"");
break; break;
case uaIdent: case uaIdent:
authmethod = "IDENT"; errstr = gettext("IDENT authentication failed for user \"%s\"");
break; break;
case uaMD5: case uaMD5:
case uaCrypt: case uaCrypt:
case uaPassword: case uaPassword:
authmethod = "Password"; errstr = gettext("Password authentication failed for user \"%s\"");
break; break;
#ifdef USE_PAM #ifdef USE_PAM
case uaPAM: case uaPAM:
authmethod = "PAM"; errstr = gettext("PAM authentication failed for user \"%s\"");
break; break;
#endif /* USE_PAM */ #endif /* USE_PAM */
default :
errstr = gettext("Unknown auth method: authentication failed for user \"%s\"");
break;
} }
ereport(FATAL, ereport(FATAL,
(errcode(ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION), (errcode(ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION),
errmsg("%s authentication failed for user \"%s\"", errmsg(errstr, port->user_name)));
authmethod, port->user_name)));
/* doesn't return */ /* doesn't return */
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment