Unix FD Passing
Lennart Poettering
mzqohf at 0pointer.de
Sat Apr 25 15:49:21 PDT 2009
On Sat, 25.04.09 11:48, Havoc Pennington (havoc.pennington at gmail.com) wrote:
>
> Hi,
>
> On Sat, Apr 25, 2009 at 10:15 AM, Lennart Poettering <mzqohf at 0pointer.de> wrote:
> >
> > Also, a client could just send three commands at once:
> > NEGOTIATE_UNIX_FD\r\nNEGOTIATE_FOO\r\nNEGOTIATE_BAR if it wants to
> > negotiate multiple things at once.
> >
>
> This seems OK as long as the AGREE and NEGOTIATE don't have to paired
> up, i.e. if the following conversation is allowed:
>
> CLIENT: NEGOTIATE FOO
> CLIENT: NEGOTIATE BAR
> SERVER: AGREE FOO
> SERVER: AGREE BAR
>
> as opposed to:
>
> CLIENT: NEGOTIATE FOO
> SERVER: AGREE FOO
> CLIENT: NEGOTIATE BAR
> SERVER: AGREE BAR
>
> But, this does raise the question, how does the client know whether an
> AGREE is coming; is there a DISAGREE?
No, but there is ERROR. The server has to respond either AGREE or ERROR
on each NEGOTIATE. The number of NEGOTIATEs and ERRORs/AGREEs must
match up. Hence issuing multiple NEGOTIATEs at the same time should be
perfectly safe.
> Basically when does the client know to proceed on to authentication?
> (when does it know all NEGOTIATE have been received and handled)
After it received a response for every single NEGOTIATE.
Lennart
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net ICQ# 11060553
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
More information about the dbus
mailing list