]> 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)
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 754cec7756b2ddb1cfcc3984265f01cb366beb76)

source3/libsmb/libsmb_dir.c

index b51a4c1377552a5c3025830f38ce6170910b381c..ff2948c9b69dd3ddfb41017383ee81b830a4f9b9 100644 (file)
@@ -1357,6 +1357,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);