Bug: tdb read-only open and truncate
Jeremy Allison
jra at samba.org
Wed Oct 3 11:29:05 GMT 2001
On Wed, Oct 03, 2001 at 08:16:40PM +0200, Elrond wrote:
>
> Hi,
>
> We got this report on tng-users and I'm forwarding it here
> with the author's permission.
>
> It clearly describes a bug in tdb.
>
> I suppose, you're also interested in fixing this.
>
>
> Elrond
>
>
> p.s.: Our tdb is in sync with tdb in head, so anything said
> here applies to your tdb (including line numbers).
>
>
> ----- Forwarded message from Phoenix <phoenix at comms.engg.susx.ac.uk> -----
>
> From: Phoenix <phoenix at comms.engg.susx.ac.uk>
> To: <tng-users at samba-tng.org>
> Subject: tdb read-only open and truncate
>
>
> there is an error in tdb.c line ~1400 where you try to truncate the tdb
> file while it is opened read-only. this is on current cvs source.
> because the truncate fails and the tdb open calls fails along with it, I
> suppose it blocks access to the dbs (I'm not aware about the structure of
> the code, thus I might me mistaken. for sure "smbstatus" does not like
> it).
>
> I changed the code to ignore the "goto fail" and log the attempts to
> truncate a read-only tdb. with one user in-session and another just loged
> in I got around 25 attempts on the log and everything seems to work fine.
> smbstatus turned back to normal, giving me a list of the locked files.
>
> not sure if this is an already known bug/error. I can reproduce it with
> extensive logs if necessary.
tdb_open should cause a failure if opened with O_RDONLY and CLEAR_IF_FIRST.
I don't think any code in HEAD or 2.2 do this, but I'll add a failure
check in tdb/tdb.c to make sure.
Thanks for the bug report,
Jeremy.
More information about the samba-technical
mailing list