]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
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)
committerJeremy Allison <jra@samba.org>
Sat, 27 Jun 2020 04:20:39 +0000 (04:20 +0000)
This is way to mark an entry as invalid (.valid = false).

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>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/smbXsrv_open.c

index b7b08e76c31da8948ac78e2b28d9de32d329a391..5180315449da281c27069cf88f23c172db19e033 100644 (file)
@@ -526,6 +526,13 @@ static NTSTATUS smbXsrv_open_global_allocate(struct db_context *db,
        }
        talloc_set_destructor(global, smbXsrv_open_global_destructor);
 
+       /*
+        * We mark every slot as invalid using 0xFF.
+        * Valid values are masked with 0xF.
+        */
+       memset(global->lock_sequence_array, 0xFF,
+              sizeof(global->lock_sequence_array));
+
        /*
         * Here we just randomly try the whole 32-bit space
         *