diff options
author | Stefan Metzmacher <metze@samba.org> | 2017-08-16 12:38:30 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2017-08-19 01:41:24 +0200 |
commit | ecca95736d3994011de2d3fd882b58ab9b450a83 (patch) | |
tree | 370bf79a5f9286903faf8058050195deb6b14b1a /source3/libsmb/libsmb_dir.c | |
parent | 379e5c1c2fa75c30b08bea7079cf1e9c46db0b26 (diff) | |
download | samba-ecca95736d3994011de2d3fd882b58ab9b450a83.tar.gz |
s3:libsmb: don't call cli_NetServerEnum() on SMB2/3 connections in SMBC_opendir_ctx()
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>
Diffstat (limited to 'source3/libsmb/libsmb_dir.c')
-rw-r--r-- | source3/libsmb/libsmb_dir.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c index 8038584138b..72441c46736 100644 --- a/source3/libsmb/libsmb_dir.c +++ b/source3/libsmb/libsmb_dir.c @@ -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, |