s3: smbclient: Stop an SMB2-connection from blundering into SMB1-specific calls.
authorJeremy Allison <jra@samba.org>
Thu, 3 Oct 2019 21:02:13 +0000 (14:02 -0700)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 7 Oct 2019 08:13:44 +0000 (08:13 +0000)
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 <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/client/client.c

index 7a7ecd92eb6f1ff2a24b4f88b315f7adbbf4b7b3..e1de711c8e4ced4b438f608e23d7246ddef28a7b 100644 (file)
@@ -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);