From: Noel Power Date: Fri, 22 Nov 2019 17:01:45 +0000 (+0000) Subject: s3/utils: Make sure we can negotiate protocol based on smb.conf settings X-Git-Tag: ldb-2.1.0~440 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5010535ec14d4e1f4dd83450432fc51a8ab53646;p=thirdparty%2Fsamba.git s3/utils: Make sure we can negotiate protocol based on smb.conf settings net_rpc_check was hardcoded to check for rpc using SMB1 only. We should negotiate protocols based on the client max|min protocol settings this commit also removes the entry for samba3.blackbox.net.misc.lookup share list from knownfails as this test should now pass following this change. Signed-off-by: Noel Power Reviewed-by: Ralph Boehme --- diff --git a/selftest/knownfail b/selftest/knownfail index a3cef7e2bc7..82259dcfe90 100644 --- a/selftest/knownfail +++ b/selftest/knownfail @@ -375,4 +375,3 @@ ^samba.tests.ntlmdisabled.python\(ktest\).python2.ntlmdisabled.NtlmDisabledTests.test_samr_change_password\(ktest\) ^samba.tests.ntlmdisabled.python\(ad_dc_no_ntlm\).python3.ntlmdisabled.NtlmDisabledTests.test_ntlm_connection\(ad_dc_no_ntlm\) ^samba.tests.ntlmdisabled.python\(ad_dc_no_ntlm\).python2.ntlmdisabled.NtlmDisabledTests.test_ntlm_connection\(ad_dc_no_ntlm\) -^samba3.blackbox.net.misc.lookup share list\(nt4_dc:local\) # when attempting to figure out if rpc is available test will fail because it tries to do this with smb1 which cannot be negotiated with this env diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 96c94e5179b..e4cf7ef05f5 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -7472,8 +7472,9 @@ bool net_rpc_check(struct net_context *c, unsigned flags) } return false; } - status = smbXcli_negprot(cli->conn, cli->timeout, PROTOCOL_CORE, - PROTOCOL_NT1); + status = smbXcli_negprot(cli->conn, cli->timeout, + lp_client_min_protocol(), + lp_client_max_protocol()); if (!NT_STATUS_IS_OK(status)) goto done; if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_NT1)