Subject: Re: getpeereid() or equivalent
To: Arne H. Juul <arnej@pvv.ntnu.no>
From: Daniel Carosone <dan@geek.com.au>
List: tech-net
Date: 08/01/2007 21:28:43
--LQFJYnjHKDAbJRTQ
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 */
>=20
>  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.
>=20
>  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.

--
Dan.

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (NetBSD)

iD8DBQFGsG5rEAVxvV4N66cRArl2AKChUAIstIDPURvAW/mHEO4Dd20EIwCgrXsd
A2NB2AQCyToMpgObNjrPXCA=
=TDpW
-----END PGP SIGNATURE-----

--LQFJYnjHKDAbJRTQ--