s3: utils: smbtree. Ensure we don't call cli_RNetShareEnum() on an SMB1 connection.
authorJeremy Allison <jra@samba.org>
Tue, 29 Oct 2019 19:11:49 +0000 (12:11 -0700)
committerKarolin Seeger <kseeger@samba.org>
Mon, 18 Nov 2019 12:55:39 +0000 (12:55 +0000)
Last unprotected call of cli_RNetShareEnum(). Not a libsmbclient
bug here but might as well fix the last caller as part of the
fix for the bug.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14174

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit f30b8b3aa1309e9daeb9a3601b537dead81e5dbb)

Autobuild-User(v4-10-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-10-test): Mon Nov 18 12:55:39 UTC 2019 on sn-devel-144

source3/utils/smbtree.c

index fb0f165a18d735fd561ddc5a435f2c3563b91c8a..2b73b0fe5902c35658a1041db1bc5c982ca0f506 100644 (file)
@@ -26,6 +26,7 @@
 #include "libsmb/libsmb.h"
 #include "libsmb/namequery.h"
 #include "libsmb/clirap.h"
+#include "../libcli/smb/smbXcli_base.h"
 
 static int use_bcast;
 
@@ -231,6 +232,10 @@ static bool get_shares(char *server_name, const struct user_auth_info *user_info
        if (get_rpc_shares(cli, add_name, &shares))
                return True;
 
+       if (smbXcli_conn_protocol(cli->conn) > PROTOCOL_NT1) {
+               return false;
+       }
+
         if (!cli_RNetShareEnum(cli, add_name, &shares))
                 return False;