1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-03 12:58:35 +03:00

smbd: Keep "the_lock"s file id separately

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2014-03-20 14:57:19 +01:00 committed by Jeremy Allison
parent ede6f44821
commit 698f7f21c2

View File

@ -351,10 +351,12 @@ static struct share_mode_lock *get_share_mode_lock_internal(
* talloc_reference.
*/
static struct share_mode_lock *the_lock;
static struct file_id the_lock_id;
static int the_lock_destructor(struct share_mode_lock *l)
{
the_lock = NULL;
ZERO_STRUCT(the_lock_id);
return 0;
}
@ -384,8 +386,9 @@ struct share_mode_lock *get_share_mode_lock(
goto fail;
}
talloc_set_destructor(the_lock, the_lock_destructor);
the_lock_id = id;
} else {
if (!file_id_equal(&the_lock->data->id, &id)) {
if (!file_id_equal(&the_lock_id, &id)) {
DEBUG(1, ("Can not lock two share modes "
"simultaneously\n"));
goto fail;