mirror of
https://github.com/samba-team/samba.git
synced 2025-03-05 20:58:40 +03:00
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)
This commit is contained in:
parent
2d96983c7c
commit
a069d4d72f
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user