summaryrefslogtreecommitdiff
path: root/source3/locking
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-04-23 14:25:04 +0000
committerAndrew Tridgell <tridge@samba.org>2000-04-23 14:25:04 +0000
commita069d4d72fea8c283dd67a08ba30b49beefcd7de (patch)
tree16b07a689dd576a38dd4087b256abe3102e71e47 /source3/locking
parent2d96983c7c95e6678ce0851af697535b7a100b09 (diff)
downloadsamba-a069d4d72fea8c283dd67a08ba30b49beefcd7de.tar.gz
samba-a069d4d72fea8c283dd67a08ba30b49beefcd7de.tar.bz2
samba-a069d4d72fea8c283dd67a08ba30b49beefcd7de.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 (This used to be commit 990b16fcf7af74f376db157a3e5de7bb68c1a4a1)
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/locking.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index affda89f08..9f33cba338 100644
--- a/source3/locking/locking.c
+++ b/source3/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);