diff options
Diffstat (limited to 'src/interfaces/libpq/fe-connect.c')
-rw-r--r-- | src/interfaces/libpq/fe-connect.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 66a91286056..3ca7e0560cd 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -2733,8 +2733,6 @@ keep_going: /* We will come back to here until there is char *startpacket; int packetlen; -#ifdef HAVE_UNIX_SOCKETS - /* * Implement requirepeer check, if requested and it's a * Unix-domain socket. @@ -2742,10 +2740,12 @@ keep_going: /* We will come back to here until there is if (conn->requirepeer && conn->requirepeer[0] && IS_AF_UNIX(conn->raddr.addr.ss_family)) { +#ifndef WIN32 char pwdbuf[BUFSIZ]; struct passwd pass_buf; struct passwd *pass; int passerr; +#endif uid_t uid; gid_t gid; @@ -2766,6 +2766,7 @@ keep_going: /* We will come back to here until there is goto error_return; } +#ifndef WIN32 passerr = pqGetpwuid(uid, &pass_buf, pwdbuf, sizeof(pwdbuf), &pass); if (pass == NULL) { @@ -2788,8 +2789,11 @@ keep_going: /* We will come back to here until there is conn->requirepeer, pass->pw_name); goto error_return; } +#else /* WIN32 */ + /* should have failed with ENOSYS above */ + Assert(false); +#endif /* WIN32 */ } -#endif /* HAVE_UNIX_SOCKETS */ if (IS_AF_UNIX(conn->raddr.addr.ss_family)) { |