From: Jeremy Allison Date: Thu, 3 Oct 2019 21:02:13 +0000 (-0700) Subject: s3: smbclient: Stop an SMB2-connection from blundering into SMB1-specific calls. X-Git-Tag: talloc-2.3.1~479 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea82bca8cef0d736305a7a40b3198fc55ea66af8;p=thirdparty%2Fsamba.git 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 --- 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);