Implementing LOCAL_CREDS socket credentials

Julio M. Merino Vidal jmmv84 at gmail.com
Sun Aug 27 12:48:20 PDT 2006


On 8/27/06, Havoc Pennington <hp at redhat.com> wrote:
> Julio M. Merino Vidal wrote:
> > The problem is, could this work?  If I understand it correctly, the
> > client sends a "AUTH EXTERNAL" message and immediately afterwards the
> > '\0' credentials byte.  The server cannot set the flag in between
> > these two messages.  Another approach could be to set the flag and
> > retrieve the credentials from the "AUTH EXTERNAL" message itself.  But
> > if this is the very first message in the connection, the server cannot
> > set the flag appropriately.  (Because the socket needs to be
> > connected; it's not possible to set LOCAL_CREDS before an accept(2).)
> >
>
> Hmm. Google search turned up this:
>
> http://lists.freebsd.org/pipermail/freebsd-bugs/2005-December/016191.html
>
> That might fix it? (set LOCAL_CREDS on the listen socket)

Oh!  I will look at it and see if it works.  Might be much easier than
the patch I just posted.

> Also raises the issue that on FreeBSD LOCAL_CREDS may be supported in
> addition to whatever we are doing on FreeBSD now (I think it does work
> on freebsd/osx now? I swear someone sent a patch for that), which just
> means we have to be careful that configure.in picks only one way to do
> it on FreeBSD.

Yep, I saw that in the code somewhere.  The changes I have done so far
prefer the "HAVE_CMSGCRED" option over "LOCAL_CREDS" when the two are
available (e.g. on FreeBSD).

Thanks,

-- 
Julio M. Merino Vidal <jmmv84 at gmail.com>
The Julipedia - http://julipedia.blogspot.com/


More information about the dbus mailing list