[Xcb] Re: new SELinux protocol reply problem

Barton C Massey bart at cs.pdx.edu
Sat Feb 24 16:57:49 PST 2007

In message <20070225001704.GA8949 at id.minilop.net> you wrote:
> On Sat, Feb 24, 2007 at 11:06:00AM -0800, Barton C Massey wrote:
> > Is there any reason XCB shouldn't accept short replies?  As
> > near as I can tell, violating the protocol spec in this
> > particular way shouldn't ought to hurt anything; JG
> > apparently agrees?
> X11 does not allow encoding replies shorter than 32 bytes without
> padding, because the length of a reply in bytes is defined as
> 	32 + reply.length * 4

Right. We'd probably have to decide that the length is
signed, which would break a bunch of existing protocol, or
we'd have to do something equally clever.  It's too late for
that---my bad.

> I think JG's comment was somewhat confusing as it was only completely
> accurate for events and errors (exactly 32 bytes), not replies (at least
> 32 bytes). The historical reasons behind these protocol details are
> always interesting though.

I think the small-size problems were probably also the
reason for the wacky reply limitation.

> > Maybe we could reject this protocol unless some explicit
> > "short-reply" attribute were set in the XML?  I doubt this
> > will be the last time the problem occurs...
> But nothing was wrong on the client side, so why would we reject it? The
> server sent a length that didn't match the number of bytes it
> transmitted, which is simply a server bug.

I guess the XML compilation warning would be if you defined
a reply type that was less than 32 bytes without either
adding padding or the special "short-reply" attribute; marginal
plan at best, but might keep that mistake from happening
again.  On the other hand, it would noise the XML some for
marginal gain.  Overall, I'll withdraw the suggestion.

Thanks much for the clarifications.


More information about the Xcb mailing list