From d67eee6f4d7679a81e8ee6f2a4476ee4afa60bd4 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 3 Oct 2019 14:02:13 -0700 Subject: [PATCH] s3: smbclient: Stop an SMB2-connection from blundering into SMB1-specific calls. Fix in the same way this was done in SMBC_opendir_ctx() for libsmbclient. This fix means the admin no longer has to remember to set 'min client protocol =' when connecting to an SMB2-only server (MacOSX for example) and trying to list shares. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14152 Signed-off-by: Jeremy Allison Reviewed-by: Andreas Schneider (cherry picked from commit ea82bca8cef0d736305a7a40b3198fc55ea66af8) --- source3/client/client.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source3/client/client.c b/source3/client/client.c index 7a7ecd92eb6..e1de711c8e4 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -4918,6 +4918,10 @@ static bool browse_host(bool sort) return false; } + if (smbXcli_conn_protocol(cli->conn) > PROTOCOL_NT1) { + return false; + } + ret = cli_RNetShareEnum(cli, browse_fn, NULL); if (ret == -1) { NTSTATUS status = cli_nt_error(cli); -- 2.20.1