Is there a way to get the uid of the other end of a unix socket connection
Posted
by
yuyichao
on Stack Overflow
See other posts from Stack Overflow
or by yuyichao
Published on 2012-03-27T23:01:22Z
Indexed on
2012/03/27
23:29 UTC
Read the original article
Hit count: 212
Is there a way for a unix socket listener to only accept connection from certain user (chmod
/chown
does not work for abstract socket afaik), or in another word, get the uid of the incoming connection (on Linux)?
Dbus, which uses abstract unix socket on Linux, has a function GetConnectionUnixUser
which is used by polkit to determine the caller. So I suppose the dbus-daemon
must have a way to do that. Does anyone know how that works?
THX
© Stack Overflow or respective owner