Skip to content

Commit 0d046a4

Browse files
committed
Fix bogus error message for SSL-cert authentication, due to lack of
a uaCert entry in auth_failed(). Put the switch entries into a sane order, namely the one the enum is declared in.
1 parent f9dbac9 commit 0d046a4

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/backend/libpq/auth.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.200 2010/04/21 03:32:53 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.201 2010/05/26 20:47:13 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -257,30 +257,33 @@ auth_failed(Port *port, int status)
257257
case uaKrb5:
258258
errstr = gettext_noop("Kerberos 5 authentication failed for user \"%s\"");
259259
break;
260-
case uaGSS:
261-
errstr = gettext_noop("GSSAPI authentication failed for user \"%s\"");
262-
break;
263-
case uaSSPI:
264-
errstr = gettext_noop("SSPI authentication failed for user \"%s\"");
265-
break;
266260
case uaTrust:
267261
errstr = gettext_noop("\"trust\" authentication failed for user \"%s\"");
268262
break;
269263
case uaIdent:
270264
errstr = gettext_noop("Ident authentication failed for user \"%s\"");
271265
break;
272-
case uaMD5:
273266
case uaPassword:
267+
case uaMD5:
274268
errstr = gettext_noop("password authentication failed for user \"%s\"");
275269
/* We use it to indicate if a .pgpass password failed. */
276270
errcode_return = ERRCODE_INVALID_PASSWORD;
277271
break;
272+
case uaGSS:
273+
errstr = gettext_noop("GSSAPI authentication failed for user \"%s\"");
274+
break;
275+
case uaSSPI:
276+
errstr = gettext_noop("SSPI authentication failed for user \"%s\"");
277+
break;
278278
case uaPAM:
279279
errstr = gettext_noop("PAM authentication failed for user \"%s\"");
280280
break;
281281
case uaLDAP:
282282
errstr = gettext_noop("LDAP authentication failed for user \"%s\"");
283283
break;
284+
case uaCert:
285+
errstr = gettext_noop("certificate authentication failed for user \"%s\"");
286+
break;
284287
case uaRADIUS:
285288
errstr = gettext_noop("RADIUS authentication failed for user \"%s\"");
286289
break;
@@ -2503,7 +2506,7 @@ CheckCertAuth(Port *port)
25032506
strlen(port->peer_cn) <= 0)
25042507
{
25052508
ereport(LOG,
2506-
(errmsg("Certificate login failed for user \"%s\": client certificate contains no username",
2509+
(errmsg("certificate authentication failed for user \"%s\": client certificate contains no username",
25072510
port->user_name)));
25082511
return STATUS_ERROR;
25092512
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy