From: Stefan Metzmacher Date: Wed, 10 Aug 2022 13:15:45 +0000 (+0000) Subject: s4:param: add --option="libsmb:client_guid=6112f7d3-9528-4a2a-8861-0ca129aae6c4"... X-Git-Tag: talloc-2.4.0~1472 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=72caffbe1115c57ad38270eaeb951f6b97bf62b3;p=thirdparty%2Fsamba.git s4:param: add --option="libsmb:client_guid=6112f7d3-9528-4a2a-8861-0ca129aae6c4" support... We already handle this in the source3/libsmb code, but it's good to have this also for torture tests. Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c index 81892d540ef..7d3891dc0b9 100644 --- a/source4/param/loadparm.c +++ b/source4/param/loadparm.c @@ -35,6 +35,15 @@ void lpcfg_smbcli_options(struct loadparm_context *lp_ctx, struct smbcli_options *options) { + struct GUID client_guid; + const char *str = NULL; + + str = lpcfg_parm_string(lp_ctx, NULL, "libsmb", "client_guid"); + if (str != NULL) { + GUID_from_string(str, &client_guid); + } else { + client_guid = GUID_random(); + } *options = (struct smbcli_options) { .max_xmit = lpcfg_max_xmit(lp_ctx), .max_mux = lpcfg_max_mux(lp_ctx), @@ -48,7 +57,7 @@ void lpcfg_smbcli_options(struct loadparm_context *lp_ctx, .use_oplocks = true, .use_level2_oplocks = true, .smb2_capabilities = SMB2_CAP_ALL, - .client_guid = GUID_random(), + .client_guid = client_guid, .max_credits = WINDOWS_CLIENT_PURE_SMB2_NEGPROT_INITIAL_CREDIT_ASK, .smb3_capabilities = smb311_capabilities_parse("client", lpcfg_client_smb3_signing_algorithms(lp_ctx),