winbindd 32/64 offset issues

Jim McDonough jmcd at
Fri Jun 22 14:15:24 GMT 2007

Despite your comments about testing with 32bit libs on 64bit platforms in
the winbindd_request struct in winbindd_nss.h, it seems we're out of sync,
and the following comment may be part of the issue:

/* Have to deal with time_t being 4 or 8 bytes due to structure alignment.
   On a 64bit Linux box, we have to support a constant structure size
   between /lib/ and /li64/
   The easiest way to do this is to always use 8byte values for time_t. */

I can say that I've recently found this to not be true.  On multiple
platforms (RHEL4 at a customer site, ubuntu Edgy on my laptop right now),
the stabs output shows the extra_data union (containing the SMB_TIME_T for
alignment) to start at 16544 bits offset, which is 2068 bytes..._not_ a
multiple of 8.  This is on 3.0.25...on 3.0.26 there is an extra enum earlier
that hides this problem, I think.  I tried several approaches, but there is
simply not a guarantee on a 32-bit platform that anything I tried is going
to be aligned on an 8-byte boundary.

The only solution I found was the old method that hasn't been updated in the
code in a while...the padding member of the huge data union needs to be set
to that 8-byte boundary, and still, since that data union isn't guaranteed
to be on an 8-byte boundary to start, we have to really just look at the
offset in stabs output and see if each union lines up between architectures.

Or we could just start up that marshalling discussion again :-)

In any case, before I check anything in, can someone run any quick tests of
your various binaries on 64-bit platforms using 32-bit winbind libs?

Jim McDonough
Samba Team
jmcd at samba dot org

More information about the samba-technical mailing list