s3:libsmb: don't call cli_NetServerEnum() on SMB2/3 connections in SMBC_opendir_ctx()
authorStefan Metzmacher <metze@samba.org>
Wed, 16 Aug 2017 10:38:30 +0000 (12:38 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 18 Aug 2017 23:41:24 +0000 (01:41 +0200)
This is all we can do with when using we allow SMB2/3 and the server supports
it, 'smb://' can't work unless we implement LLMNR and maybe WSD.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/libsmb_dir.c

index 8038584138b55828ff0d50976bfd2daf67a2677c..72441c4673649cbe1289a2b56f0d77808733e4b1 100644 (file)
@@ -590,6 +590,10 @@ SMBC_opendir_ctx(SMBCCTX *context,
                                 continue;
                         }
 
+                       if (smbXcli_conn_protocol(srv->cli->conn) > PROTOCOL_NT1) {
+                               continue;
+                       }
+
                         dir->srv = srv;
                         dir->dir_type = SMBC_WORKGROUP;
 
@@ -704,6 +708,15 @@ SMBC_opendir_ctx(SMBCCTX *context,
 
                                dir->srv = srv;
 
+                               if (smbXcli_conn_protocol(srv->cli->conn) > PROTOCOL_NT1) {
+                                       if (dir) {
+                                               SAFE_FREE(dir->fname);
+                                               SAFE_FREE(dir);
+                                       }
+                                       TALLOC_FREE(frame);
+                                       return NULL;
+                               }
+
                                /* Now, list the servers ... */
                                if (!cli_NetServerEnum(srv->cli, wgroup,
                                                        0x0000FFFE, list_fn,