Implementing LOCAL_CREDS socket credentials

Julio M. Merino Vidal jmmv84 at gmail.com
Sun Aug 27 15:12:23 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)

You were right; thanks!  That works fine so far and makes for a much,
much simpler fix without breaking compatibility!  See the attached
patch.

I'm now afraid of some other not-yet-tested system providing
LOCAL_CREDS only but having the same "bug" FreeBSD had (if that can be
considered a bug) ;-)

Kind regards,

-- 
Julio M. Merino Vidal <jmmv84 at gmail.com>
The Julipedia - http://julipedia.blogspot.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-patch
Size: 4855 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20060828/062cb306/patch-0001.bin


More information about the dbus mailing list