mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
smbd: Avoid checking the_lock->id for fresh locks
If we just fetched the lock, this check will always be true. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
c416b34648
commit
ede6f44821
@ -385,15 +385,16 @@ struct share_mode_lock *get_share_mode_lock(
|
||||
}
|
||||
talloc_set_destructor(the_lock, the_lock_destructor);
|
||||
} else {
|
||||
if (!file_id_equal(&the_lock->data->id, &id)) {
|
||||
DEBUG(1, ("Can not lock two share modes "
|
||||
"simultaneously\n"));
|
||||
goto fail;
|
||||
}
|
||||
if (talloc_reference(lck, the_lock) == NULL) {
|
||||
DEBUG(1, ("talloc_reference failed\n"));
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
if (!file_id_equal(&the_lock->data->id, &id)) {
|
||||
DEBUG(1, ("Can not lock two share modes simultaneously\n"));
|
||||
goto fail;
|
||||
}
|
||||
lck->data = the_lock->data;
|
||||
return lck;
|
||||
fail:
|
||||
|
Loading…
Reference in New Issue
Block a user