summaryrefslogtreecommitdiff
path: root/source3/locking
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-12-14 17:46:29 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:50 -0500
commite7d2e311a293709c74a97d0e30665dadae510712 (patch)
tree2665f0c73d2e557d85b47ccfc826f485af959614 /source3/locking
parent765daab643c2957297e71b26de515c05b04d244d (diff)
downloadsamba-e7d2e311a293709c74a97d0e30665dadae510712.tar.gz
samba-e7d2e311a293709c74a97d0e30665dadae510712.tar.bz2
samba-e7d2e311a293709c74a97d0e30665dadae510712.zip
r12234: Reduce the race condition for renames by holding the lock
longer. Instigated by complaints on the fix for #3303 from SATOH Fumiyasu <fumiyas@miraclelinux.com>. Jeremy. (This used to be commit 855f5f8c32aa530dbad244805a40200824724618)
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/locking.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index b823b4712e..07377831b4 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -605,8 +605,8 @@ struct share_mode_lock *get_share_mode_lock(TALLOC_CTX *mem_ctx,
lck->num_share_modes = 0;
lck->share_modes = NULL;
lck->delete_on_close = False;
- lck->modified = False;
lck->fresh = False;
+ lck->modified = False;
if (tdb_chainlock(tdb, key) != 0) {
DEBUG(3, ("Could not lock share entry\n"));
@@ -668,6 +668,10 @@ BOOL rename_share_filename(struct share_mode_lock *lck,
size_t msg_len;
int i;
+ if (!lck) {
+ return False;
+ }
+
DEBUG(10, ("rename_share_filename: servicepath %s newname %s\n",
servicepath, newname));