CVS update: samba/source/locking

Tim Potter tpot at linuxcare.com.au
Wed May 10 10:29:41 EST 2000


Herb Lewis writes:

> Update of /data/cvs/samba/source/locking
> In directory samba:/tmp/cvs-serv23350/locking
> 
> Modified Files:
> 	brlock.c locking.c posix.c 
> Log Message:
> Using a structure for a tdb key can lead to insideous, hard
> to find bugs. On 64 bit IRIX, structure packing means that
> a
> struct { 
> SMB_DEV_T dev /* 4 bytes */
> SMB_INO_T ino /* 8 bytes */
> }
> 
> has 4 bytes of padding between the two members. If you
> don't null the memory before using it as a tdb key, 
> you randomly can't find keys depending on what is in
> the padding. This caused me immense pain and was hard
> to track down.... :-)

Ouch.  I prefer using string keys - easier to debug and you can
less the tdb file and get an idea of what it contains.  How about
doing something like converting the dev and ino into a hex string
using sprintf and using that as a key?


Regards,

Tim.

> Jeremy.



More information about the samba-cvs mailing list