From eddcbfea91d012f70a00c3ff2865fb1a23bec023 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 4 Sep 2018 11:11:49 +0200 Subject: [PATCH] s3:smbclient: Do not call cli_RNetShareEnum if SMB1 is disabled Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison --- source3/client/client.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source3/client/client.c b/source3/client/client.c index adc3fcab476..fc6d9a31c5b 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -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)); -- 2.47.2