]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: libsmbclient: Ensure SMBC_readdir_ctx() also updates the readdirplus pointers.
authorJeremy Allison <jra@samba.org>
Mon, 26 Aug 2019 16:54:06 +0000 (09:54 -0700)
committerKarolin Seeger <kseeger@samba.org>
Thu, 19 Sep 2019 07:04:30 +0000 (07:04 +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>
(cherry picked from commit 4bca8e097f5a909c628daa4dbfa932ddc1725ebc)

source3/libsmb/libsmb_dir.c

index ff19ed57f14ac222dff9ca783f71139ed5f6ff62..35215fdfbb5c077675fee1ef308e9013cd3ed69c 100644 (file)
@@ -1173,6 +1173,17 @@ SMBC_readdir_ctx(SMBCCTX *context,
 
         dir->dir_next = dir->dir_next->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);
         return dirp;
 }