From: Stefan Metzmacher Date: Mon, 19 Jun 2017 06:49:05 +0000 (+0200) Subject: s3:client: smbclient -L can't do workgroup listing over SMB2/3 X-Git-Tag: tevent-0.9.32~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2726c1a1b0c69d618248b607eca2b0845ddda41d;p=thirdparty%2Fsamba.git s3:client: smbclient -L can't do workgroup listing over SMB2/3 Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- 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;