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, Iain Hibbert wrote:

> 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

actually, its NOT SOL_SOCKET but an AF_LOCAL option, you need to use

        setsockopt(s, 0, LOCAL_CREDS, ...)

which probably will assist with your problem..


Home | Main Index | Thread Index | Old Index