]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/libsmb: check for global parametric option "libsmb:client_guid"
authorStefan Metzmacher <metze@samba.org>
Mon, 5 Oct 2020 06:52:32 +0000 (08:52 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 4 Nov 2021 19:04:31 +0000 (19:04 +0000)
Useful in test.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14882

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/libsmb/clientgen.c

index a5929ecc7dfedf16be5aa67fdb7cdcdc0ebd4929..5f0b9daf33310aea4cf7b252778598d97a5094ea 100644 (file)
@@ -79,7 +79,14 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
        if (!GUID_all_zero(&cli_state_client_guid)) {
                client_guid = cli_state_client_guid;
        } else {
-               client_guid = GUID_random();
+               const char *str = NULL;
+
+               str = lp_parm_const_string(-1, "libsmb", "client_guid", NULL);
+               if (str != NULL) {
+                       GUID_from_string(str, &client_guid);
+               } else {
+                       client_guid = GUID_random();
+               }
        }
 
        /* Check the effective uid - make sure we are not setuid */