Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Jul 2017 10:03:01 +0200
From:      Johannes Lundberg <johalun0@gmail.com>
To:        freebsd-current <freebsd-current@freebsd.org>
Subject:   Getting PID of socket client
Message-ID:  <CAECmPwsD=PYqoG9EA=Wyq16hcrdbf7SQ3Owxdf%2BWSvYWazJfXA@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi

Without altering the client code (i.e. adding sendmsg(credentials)), is
there anyway of getting the client PID (or path to binary) using the file
descriptor returned by accept() on the server side?

Similar to Linux's getsockopt with SO_PEERCRED option.

Thanks!



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAECmPwsD=PYqoG9EA=Wyq16hcrdbf7SQ3Owxdf%2BWSvYWazJfXA>