s3/utils: Make sure we can negotiate protocol based on smb.conf settings
authorNoel Power <noel.power@suse.com>
Fri, 22 Nov 2019 17:01:45 +0000 (17:01 +0000)
committerRalph Boehme <slow@samba.org>
Thu, 5 Dec 2019 17:14:47 +0000 (17:14 +0000)
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 <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
selftest/knownfail
source3/utils/net_rpc.c

index a3cef7e2bc770710991e9ebc400ccc611b29b21b..82259dcfe907a6f71db6b61cf56a0cccf15e9c2c 100644 (file)
 ^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
index 96c94e5179bffa2b570eab6f45e68a6b0a5b1291..e4cf7ef05f54648eb0736f61cee360037bb3f5d1 100644 (file)
@@ -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)