tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: SCM_CREDS ancillary data



On Fri, 4 Jul 2008, Matthew Mondor wrote:

> On some OSs the sender must send a cmsghdr with SCM_CREDS set but
> without appended creds structure, and length set to the cmsghdr only.
> On NetBSD, it appears that the client cannot do so (EINVAL results,
> and uipc_userreq.c read confirms that only SCM_RIGHTS can be sent).
> I've also tried setting the UNP_WANTCREDS flag immediately before
> send/recv calls via setsockopt(2) but this did not work either.
> SO_LOCALCRED also doesn't seem to exist on NetBSD, so I'm confused.

IIRC its (SOL_SOCKET, LOCAL_CREDS) see unix(4) for the details - I used it
in sdpd(8) and it does still work ok that I know of, see
usr.sbin/sdpd/server.c for an example.

The kernel creates the SCM_CREDS message as required by the server, there
is no way for the client to send such a message and it does not need to
set any LOCAL_CREDS option.

iain


Home | Main Index | Thread Index | Old Index