Subject: Re: getpeereid() or equivalent
To: Arne H. Juul <>
From: Daniel Carosone <>
List: tech-net
Date: 08/01/2007 21:28:43
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Aug 01, 2007 at 11:27:17AM +0200, Arne H. Juul wrote:
>  blackbox:~:$ grep -r SO_PEERCRED /usr/include/
>  blackbox:~:$ grep -r LOCAL_PEERCRED /usr/include/
>  blackbox:~:$ grep -r LOCAL_CREDS /usr/include/
>  /usr/include/sys/un.h:#define   LOCAL_CREDS     0x0001          /* pass
>  credentials to receiver */
>  only the LOCAL_CREDS that I mentioned in my first mail is defined.

Yeah. Despite my flaky memory, and my quick check to confirm the name
in the postgresql doc, this must be what pg is using on netbsd - since
I know it works and I use it many times each day.

> >> For usage examples, see postgresql or ssh code.
>  the ssh code looks really bad to me when SO_PEERCRED is undefined.

It really does, at least for a general-purpose function, but I guess
it depends how the callers use the result.


Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.4.7 (NetBSD)