s3:smbXsrv_open: initialize smbXsrv_open_global->lock_sequence_array with 0xFF
authorStefan Metzmacher <metze@samba.org>
Wed, 24 Oct 2012 13:17:56 +0000 (15:17 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 13 Aug 2018 15:34:53 +0000 (17:34 +0200)
This does not match the current documentation, but is very likely the
right thing to do.

If we would match the documentation and initialize with 0x00,
we would return STATUS_SUCCESS without doing any locks.
If the client also follows the documentation and starts
with a lock_sequence of 0 for the first operation.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
source3/smbd/smbXsrv_open.c

index 2a2cf6973e7da28f415737b99677469531d07783..90979585c2eaa0a4094772fd8accf4a3393b3dda 100644 (file)
@@ -526,6 +526,9 @@ static NTSTATUS smbXsrv_open_global_allocate(struct db_context *db,
        }
        talloc_set_destructor(global, smbXsrv_open_global_destructor);
 
+       memset(global->lock_sequence_array, 0xFF,
+              sizeof(global->lock_sequence_array));
+
        /*
         * Here we just randomly try the whole 32-bit space
         *