]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: libsmbclient: Ensure SMBC_getdents_ctx() also updates the readdirplus pointers.
authorJeremy Allison <jra@samba.org>
Mon, 26 Aug 2019 17:07:32 +0000 (10:07 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 3 Sep 2019 16:15:36 +0000 (16:15 +0000)
If we are returning file entries, we
have a duplicate list in dirplus.

Update dirplus_next also so readdir and
readdirplus are kept in sync.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14094

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

index 2f2117e8131a398614c5b1560b330de1a4818266..4447806c1083f431ff008a8fcc15f82fe4de1c9a 100644 (file)
@@ -1358,6 +1358,17 @@ SMBC_getdents_ctx(SMBCCTX *context,
                }
 
                dir->dir_next = dirlist = dirlist -> next;
+
+               /*
+                * If we are returning file entries, we
+                * have a duplicate list in dirplus.
+                *
+                * Update dirplus_next also so readdir and
+                * readdirplus are kept in sync.
+                */
+               if (dir->dirplus_list != NULL) {
+                       dir->dirplus_next = dir->dirplus_next->next;
+               }
        }
 
        TALLOC_FREE(frame);