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>
Tue, 15 Oct 2019 07:36:22 +0000 (09:36 +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.

Pair-Programmed-With: Michael Adam <obnox@samba.org>

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

index b7b08e76c31da8948ac78e2b28d9de32d329a391..2be1d54d6ce441505c59482e6ed865b6eea6cea2 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
         *