summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2017-06-19 08:49:05 +0200
committerStefan Metzmacher <metze@samba.org>2017-06-22 13:07:40 +0200
commit2726c1a1b0c69d618248b607eca2b0845ddda41d (patch)
treee46c74542cd50105856b2da6056dc2210db2e91a
parentb18a04b4bb6aec9bd1fd9a23997197605fb7922e (diff)
downloadsamba-2726c1a1b0c69d618248b607eca2b0845ddda41d.tar.gz
s3:client: smbclient -L can't do workgroup listing over SMB2/3
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/client/client.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 3285240d404..375d9e3e4d9 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -5646,16 +5646,21 @@ static int do_host_query(const char *query_host)
goto out;
}
- if (port != NBT_SMB_PORT) {
+ if (port != NBT_SMB_PORT ||
+ smbXcli_conn_protocol(cli->conn) > PROTOCOL_NT1)
+ {
+ int max_proto = MIN(max_protocol, PROTOCOL_NT1);
- /* Workgroups simply don't make sense over anything
- else but port 139... */
+ /*
+ * Workgroups simply don't make sense over anything
+ * else but port 139 and SMB1.
+ */
cli_shutdown(cli);
status = cli_cm_open(talloc_tos(), NULL,
have_ip ? dest_ss_str : query_host,
"IPC$", popt_get_cmdline_auth_info(),
- true, smb_encrypt, max_protocol,
+ true, smb_encrypt, max_proto,
NBT_SMB_PORT, name_type, &cli);
if (!NT_STATUS_IS_OK(status)) {
cli = NULL;