Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unix Domain socket Peer Credentials?

0 views
Skip to first unread message

Per Schröder

unread,
Oct 21, 2002, 12:39:43 PM10/21/02
to
Hello!

Does anyone know a way for a server that accepts a UNIX Domain stream
connection from a client to know exactly the UID of the client?

I'm not using STREAMS.

On Linux, I can create an unnamed socket and get the peer credentials by
using getsockopt(). Is something similar available on AIX?
getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &crlen);

I am also aware of Stevens, Advanced Programming in the UNIX Environment,
chapter 15.5.2, but this method does not work so good if the server is not
root. Also the method is not "perfect" as the book says.

Which AIX documentation covers passing credentials / access rights?

Any help is appreciated.

--
/Per Schröder
http://developer.mimer.com

0 new messages