From e7d2e311a293709c74a97d0e30665dadae510712 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 14 Dec 2005 17:46:29 +0000 Subject: r12234: Reduce the race condition for renames by holding the lock longer. Instigated by complaints on the fix for #3303 from SATOH Fumiyasu . Jeremy. (This used to be commit 855f5f8c32aa530dbad244805a40200824724618) --- source3/locking/locking.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3/locking') 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)); -- cgit