summaryrefslogtreecommitdiff
path: root/source3/locking
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-05-21 23:07:04 +0000
committerJeremy Allison <jra@samba.org>2002-05-21 23:07:04 +0000
commit98548e188ac72c16a809bb54cd3e81a22d150513 (patch)
tree0f4affd2f3e201c4cd043c4c2980ced3a2db65ea /source3/locking
parente486d0fa03113bdabb0d97f0d91eb7fc488fa361 (diff)
downloadsamba-98548e188ac72c16a809bb54cd3e81a22d150513.tar.gz
samba-98548e188ac72c16a809bb54cd3e81a22d150513.tar.bz2
samba-98548e188ac72c16a809bb54cd3e81a22d150513.zip
Failing to find an entry when doing mod_share_entry isn't a error
condition, as we look for the entry before locking the chain - thus someone else could have legitimately deleted it. Jeremy. (This used to be commit bd64a291a8df63a6e0f9e166ad9ea7d92adbb4d5)
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/locking.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index 87df805250..d42d041b79 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -681,6 +681,7 @@ static BOOL mod_share_mode( SMB_DEV_T dev, SMB_INO_T inode, share_mode_entry *en
int i;
share_mode_entry *shares;
BOOL need_store=False;
+ BOOL ret = True;
/* read in the existing share modes */
dbuf = tdb_fetch(tdb, locking_key(dev, inode));
@@ -702,15 +703,15 @@ static BOOL mod_share_mode( SMB_DEV_T dev, SMB_INO_T inode, share_mode_entry *en
if (need_store) {
if (data->u.num_share_mode_entries == 0) {
if (tdb_delete(tdb, locking_key(dev, inode)) == -1)
- need_store = False;
+ ret = False;
} else {
if (tdb_store(tdb, locking_key(dev, inode), dbuf, TDB_REPLACE) == -1)
- need_store = False;
+ ret = False;
}
}
SAFE_FREE(dbuf.dptr);
- return need_store;
+ return ret;
}
/*******************************************************************