s3:smbclient: Do not call cli_RNetShareEnum if SMB1 is disabled
authorAndreas Schneider <asn@samba.org>
Tue, 4 Sep 2018 09:11:49 +0000 (11:11 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 5 Sep 2018 16:22:24 +0000 (18:22 +0200)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/client/client.c

index adc3fcab476e3fac824b6b0c265294bdec7f85d3..fc6d9a31c5ba8be334fcfbfafd90925be7b880ed 100644 (file)
@@ -4901,6 +4901,7 @@ static bool browse_host_rpc(bool sort)
 static bool browse_host(bool sort)
 {
        int ret;
+
        if (!grepable) {
                d_printf("\n\tSharename       Type      Comment\n");
                d_printf("\t---------       ----      -------\n");
@@ -4910,7 +4911,12 @@ static bool browse_host(bool sort)
                return true;
        }
 
-       if((ret = cli_RNetShareEnum(cli, browse_fn, NULL)) == -1) {
+       if (lp_client_min_protocol() > PROTOCOL_NT1) {
+               return false;
+       }
+
+       ret = cli_RNetShareEnum(cli, browse_fn, NULL);
+       if (ret == -1) {
                NTSTATUS status = cli_nt_error(cli);
                d_printf("Error returning browse list: %s\n",
                         nt_errstr(status));