From: Andre Nathan Date: 2004-05-19T20:44:25+09:00 Subject: Re: RCR: UNIX credentials On Wed, 2004-05-19 at 07:04, Guillaume Marcais wrote: > 1) This works fine too: > class UNIXSocket > def getpeercredentials > getsockopt(Socket::SOL_SOCKET, Socket::SO_PEERCRED).unpack("i3") > end > end > > No need for C code. Tested on Linux. A web search tells me that the > SO_PEERCRED option is supported on the BSD family as well. According to David Wheeler[1] this is a Linux-only thing. Also, the Unix Network Programming book says there's no portable way of doing that (but shows how to do it on FreeBSD, using SCM_CREDS IIRC). Best regards, Andre [1]http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO/sockets.html -- design, v.: What you regret not doing later on.