Re: Please test peer (socket ident) auth on *BSD

From: Marko Kreen <markokr(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Greg Stark <gsstark(at)mit(dot)edu>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Bruce Momjian <bruce(at)momjian(dot)us>
Subject: Re: Please test peer (socket ident) auth on *BSD
Date: 2011-06-02 16:47:44
Message-ID: BANLkTinPiA-2YoZP6p8bZ7o4gNCw5j2+nw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 2, 2011 at 7:44 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Marko Kreen <markokr(at)gmail(dot)com> writes:
>> On Thu, Jun 2, 2011 at 7:20 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>>> Then maybe we need to use "#ifndef WIN32" in those places. That's what we do
>>> for similar cases.
>
>> No, that would be a bad idea - uglifies code for no good reason.
>
>> The function is referenced undef IS_AF_UNIX() check, so it would
>> not be run anyway.  Even if it would run somehow, there is only
>> 2 lines to return ENOSYS.
>
> Yeah, but not compiling thirty lines in fe-connect.c is worthwhile.
>
> The auth_peer code in the backend is #ifdef HAVE_UNIX_SOCKETS, and
> I see no reason why this chunk in libpq shouldn't be as well.

ip.h:

#ifdef HAVE_UNIX_SOCKETS
#define IS_AF_UNIX(fam) ((fam) == AF_UNIX)
#else
#define IS_AF_UNIX(fam) (0)
#endif

This the #ifdefs-in-headers-only approach to the problem...

--
marko

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2011-06-02 16:48:42 Re: creating CHECK constraints as NOT VALID
Previous Message Marko Kreen 2011-06-02 16:45:04 Re: Please test peer (socket ident) auth on *BSD