Skip to content

Commit fb8ac3f

Browse files
committed
Dept. of third thoughts: in fact, libpq should support SCM_CREDS challenge
even when HAVE_GETPEEREID is defined, else it will be unable to connect to pre-7.4 backends that are using IDENT authentication.
1 parent b8f2980 commit fb8ac3f

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/interfaces/libpq/fe-auth.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* exceed INITIAL_EXPBUFFER_SIZE (currently 256 bytes).
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.87 2003/12/20 18:24:52 tgl Exp $
13+
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.88 2003/12/20 18:45:49 tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -450,16 +450,15 @@ pg_krb5_sendauth(char *PQerrormsg, int sock, const char *hostname)
450450
/*
451451
* Respond to AUTH_REQ_SCM_CREDS challenge.
452452
*
453-
* Note: the backend will not use this challenge if HAVE_GETPEEREID
454-
* or SO_PEERCRED is defined, so we don't bother to compile any code
455-
* in that case, even if the facility is available.
453+
* Note: current backends will not use this challenge if HAVE_GETPEEREID
454+
* or SO_PEERCRED is defined, but pre-7.4 backends might, so compile the
455+
* code anyway.
456456
*/
457457
static int
458458
pg_local_sendauth(char *PQerrormsg, PGconn *conn)
459459
{
460-
#if !defined(HAVE_GETPEEREID) && !defined(SO_PEERCRED) && \
461-
(defined(HAVE_STRUCT_CMSGCRED) || defined(HAVE_STRUCT_FCRED) || \
462-
(defined(HAVE_STRUCT_SOCKCRED) && defined(LOCAL_CREDS)))
460+
#if defined(HAVE_STRUCT_CMSGCRED) || defined(HAVE_STRUCT_FCRED) || \
461+
(defined(HAVE_STRUCT_SOCKCRED) && defined(LOCAL_CREDS))
463462
char buf;
464463
struct iovec iov;
465464
struct msghdr msg;

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