diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-04-23 14:25:04 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-04-23 14:25:04 +0000 |
commit | 990b16fcf7af74f376db157a3e5de7bb68c1a4a1 (patch) | |
tree | 57865e8b1a83295f9296c9c9e5c949d93eb16d60 /source/locking | |
parent | defbedd198f02f7bb9af70436f5a25ab754b5fb6 (diff) | |
download | samba-990b16fcf7af74f376db157a3e5de7bb68c1a4a1.tar.gz samba-990b16fcf7af74f376db157a3e5de7bb68c1a4a1.tar.xz samba-990b16fcf7af74f376db157a3e5de7bb68c1a4a1.zip |
fixed a locking database bug - it was actually harmless except that
smbstatus could display the wrong filename when files change dev/inum
after a rename
Diffstat (limited to 'source/locking')
-rw-r--r-- | source/locking/locking.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/locking/locking.c b/source/locking/locking.c index affda89f08c..9f33cba338f 100644 --- a/source/locking/locking.c +++ b/source/locking/locking.c @@ -708,7 +708,11 @@ void del_share_mode(files_struct *fsp) dbuf.dsize -= del_count * sizeof(*shares); /* store it back in the database */ - tdb_store(tdb, locking_key_fsp(fsp), dbuf, TDB_REPLACE); + if (data->num_share_mode_entries == 0) { + tdb_delete(tdb, locking_key_fsp(fsp)); + } else { + tdb_store(tdb, locking_key_fsp(fsp), dbuf, TDB_REPLACE); + } free(dbuf.dptr); } @@ -815,7 +819,11 @@ static BOOL mod_share_mode(files_struct *fsp, /* if the mod fn was called then store it back */ if (need_store) { - tdb_store(tdb, locking_key_fsp(fsp), dbuf, TDB_REPLACE); + if (data->num_share_mode_entries == 0) { + tdb_delete(tdb, locking_key_fsp(fsp)); + } else { + tdb_store(tdb, locking_key_fsp(fsp), dbuf, TDB_REPLACE); + } } free(dbuf.dptr); |