I have a program that is listening to a Unix Domain Socket.
When a client connects to the socket I\'d like to find out which program connected and then decide if I allow
Perhaps getpeername or getsockname could help. and I think that the permission of your unix socket are useful (not sure of that). And you might read the link inside /proc/self/fd/12
if your accept
-ed socket is 12.
EDIT
using ancillary data for credentials and sendmsg
is much better, as suggested by cnicutar below.