]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: libsmb: Ensure we don't call cli_RNetShareEnum() on an SMB1 connection.
authorJeremy Allison <jra@samba.org>
Tue, 29 Oct 2019 19:11:01 +0000 (12:11 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 30 Oct 2019 20:44:31 +0000 (20:44 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14174

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/libsmb/libsmb_dir.c

index df606c4adfeef1fb5e5b0842e7f95bc229537d0f..ab20a127c49b08e24ce06f523deacc54d18908c7 100644 (file)
@@ -856,7 +856,12 @@ SMBC_opendir_ctx(SMBCCTX *context,
                                                        list_fn,
                                                        (void *)dir);
                                if (rc != 0 &&
-                                   lp_client_min_protocol() <= PROTOCOL_NT1) {
+                                   smbXcli_conn_protocol(srv->cli->conn) <=
+                                               PROTOCOL_NT1) {
+                                       /*
+                                        * Only call cli_RNetShareEnum()
+                                        * on SMB1 connections, not SMB2+.
+                                        */
                                        rc = cli_RNetShareEnum(srv->cli,
                                                               list_fn,
                                                               (void *)dir);