A nit: when the socket is created, it has the uid/gid of the process
that created it stored in it's internals (see sock_alloc() in net/socket.c
of your linux kernel). When you accept() on a socket, you get a new
socket also created with sock_alloc(), which should end up with whatever
the current uid/gid happen to be at that moment.
Someone always owns it. It may not be who you'd like it to be, but
someone unique always owns it.
Your UID argument may be flawed, but your PID argument is not.
Thanks for the correction.
What I wonder is what do these uid/gid should mean? Will they update
when the process changes uid/gid? And what about two processes owned
by two different users who share the same socket (the situation I
described in my original article)?
--Amos Shapira | "Of course Australia was marked for
133 Shlomo Ben-Yosef st. | glory, for its people had been chosen
Jerusalem 93 805 | by the finest judges in England."