aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-auth.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-12-20 18:24:52 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-12-20 18:24:52 +0000
commitb8f2980209876f060a189cc1dbc4af520b735791 (patch)
treeb2edd5964b5ca9e13356a29a099321c3df100ee4 /src/interfaces/libpq/fe-auth.c
parentd75b2ec4ebbc7fdb51088e89da47c6523bf2c640 (diff)
downloadpostgresql-b8f2980209876f060a189cc1dbc4af520b735791.tar.gz
postgresql-b8f2980209876f060a189cc1dbc4af520b735791.zip
Fix broken IDENT support for FreeBSD (appears to have been broken by
ill-considered conditional logic in getpeereid patch of 3-Dec-2002). Per bug #1021.
Diffstat (limited to 'src/interfaces/libpq/fe-auth.c')
-rw-r--r--src/interfaces/libpq/fe-auth.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/interfaces/libpq/fe-auth.c b/src/interfaces/libpq/fe-auth.c
index 146b832e3c6..f3aa18dff57 100644
--- a/src/interfaces/libpq/fe-auth.c
+++ b/src/interfaces/libpq/fe-auth.c
@@ -10,7 +10,7 @@
* exceed INITIAL_EXPBUFFER_SIZE (currently 256 bytes).
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.86 2003/11/29 19:52:11 pgsql Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.87 2003/12/20 18:24:52 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -447,12 +447,19 @@ pg_krb5_sendauth(char *PQerrormsg, int sock, const char *hostname)
}
#endif /* KRB5 */
+/*
+ * Respond to AUTH_REQ_SCM_CREDS challenge.
+ *
+ * Note: the backend will not use this challenge if HAVE_GETPEEREID
+ * or SO_PEERCRED is defined, so we don't bother to compile any code
+ * in that case, even if the facility is available.
+ */
static int
pg_local_sendauth(char *PQerrormsg, PGconn *conn)
{
-#if defined(HAVE_STRUCT_CMSGCRED) || defined(HAVE_STRUCT_FCRED) || \
- (defined(HAVE_STRUCT_SOCKCRED) && defined(LOCAL_CREDS)) && \
- !defined(HAVE_GETPEEREID) && !defined(SO_PEERCRED)
+#if !defined(HAVE_GETPEEREID) && !defined(SO_PEERCRED) && \
+ (defined(HAVE_STRUCT_CMSGCRED) || defined(HAVE_STRUCT_FCRED) || \
+ (defined(HAVE_STRUCT_SOCKCRED) && defined(LOCAL_CREDS)))
char buf;
struct iovec iov;
struct msghdr msg;