A bug with getsockopt(SOL_LOCAL, LOCAL_PEERCRED) ?

Gleb Popov arrowd at freebsd.org
Thu Apr 15 19:22:09 UTC 2021


On Thu, Apr 15, 2021 at 10:16 PM Konstantin Belousov <kostikbel at gmail.com>
wrote:

> You are calling getsockopt(2) in the listen socket, not on the connected
> one.
> Replace s with s2 in the call.
>

The `man unix ` says:

The credentials presented to the server (the
listen(2) caller) are those of the client
when it called connect(2); the credentials
presented to the client (the connect(2)
caller) are those of the server when it
called listen(2).

This is what I actually want - to find out credentials of the connected
user.


More information about the freebsd-hackers mailing list