BUG: Incompatibility between Samba & Secure kernels (fwd)

Jeremy Allison jeremy at valinux.com
Thu Jul 5 18:31:57 GMT 2001

David Collier-Brown wrote:
>         On the other hand, Samba's behavior on failure
>         is a bit frightening (:-)) In tdb_mmap() intdb.c,
>         we return NULL to the callers, but the callers
>         behave differently...
> Functions calling this function: tdb_mmap
>   File  Function   Line
> 1 tdb.c tdb_oob     209 tdb->map_ptr = tdb_mmap(tdb->map_size,
>                         tdb->read_only,tdb->fd);
> 2 tdb.c tdb_expand  465 tdb->map_ptr = tdb_mmap(tdb->map_size, 0,
> tdb->fd);
> 3 tdb.c tdb_open   1139 tdb.map_ptr = tdb_mmap(st.st_size,
> tdb.read_only,
>                         tdb.fd);
> tdb_oob() and tdb_expand() just stuff the null into tdb->map_ptr,
> and tdb_open() returns a pointer to the null.  None of the three
> check for failure, although they have code to check for other
> failures. This is arguably A Bad Thing.

This has been changed in the current sources. tdb_mmap
now returns a void and takes care of failure within itself.

None of the other tdb code depends on the mmap pointer being
valid (it'll fall back to read)/write() call instead).


Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.

More information about the samba-technical mailing list