tdb question

daniel.jarboe at daniel.jarboe at
Thu May 20 13:12:06 GMT 2004

In tdb.c:tdb_reopen_all (3.0.3 and 3.0.4), the TDB_CLEAR_IF_FIRST flag
is cleared before the tdb_reopen call.  Is there a reason for this?  It
appears that the only effect of this flag being unset is the process
does not reacquire a non-exclusive read lock on ACTIVE which leaves the
possibility of a tdb being truncated/re-created while it is in use by
another process.

As far as I can tell in Samba, the parent smbd always keeps
TDB_CLEAR_IF_FIRST tdb's open and locked so it appears that one process
is using the tdb (though several processes may be), but if the parent
closes it or any other fcntl-locked file, the lock is lost and the tdb
no longer appears to be in use by any processes, and could be cleared by
the next open.

Patch against 3.0.4 attached, but only because I can't see any reason
why it is there in the first place... ?
~ Daniel



This message is the property of Time Inc. or its affiliates. It may be
legally privileged and/or confidential and is intended only for the use
of the addressee(s). No addressee should forward, print, copy, or
otherwise reproduce this message in any manner that would allow it to be
viewed by any individual not originally listed as a recipient. If the
reader of this message is not the intended recipient, you are hereby
notified that any unauthorized disclosure, dissemination, distribution,
copying or the taking of any action in reliance on the information
herein is strictly prohibited. If you have received this communication
in error, please immediately notify the sender and delete this message.
Thank you.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tdb.diff
Type: application/octet-stream
Size: 349 bytes
Desc: tdb.diff
Url :

More information about the samba-technical mailing list