CVS update: samba/source/locking
Luke Kenneth Casson Leighton
lkcl at samba.org
Wed May 10 16:41:32 EST 2000
solution: create an NDR marshalling / unmarshalling routine,
smb_io_dev_t(), smb_io_ino_t().
then use prs_tdb_store() and prs_tdb_fetch(), wrapped with about five
lines of code [prs_init(), smb_io_brlock(), prs_tdb_fetch(), prs_free(),
big deal], to store or fetch data structures.
On Wed, 10 May 2000, Herb Lewis wrote:
>
> Date: Wednesday May 10, 2000 @ 10:05
> Author: herb
>
> 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.... :-)
>
> Jeremy.
>
<a href=" mailto:lkcl at samba.org" > Luke Kenneth Casson Leighton </a>
<a href=" http://cb1.com/~lkcl" > Samba and Network Development </a>
<a href=" http://samba.org" > Samba Web site </a>
<a href=" http://mcp.com" > Macmillan Technical Publishing </a>
ISBN1578701503 DCE/RPC over SMB: Samba and Windows NT Domain Internals
More information about the samba-cvs
mailing list