summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2019-08-26 10:07:32 -0700
committerKarolin Seeger <kseeger@samba.org>2019-09-19 07:04:30 +0000
commit588c84d488289c069822ac87f645049f328afd1c (patch)
tree81938e88411c58e26bde11ed0df1cb365a7add4f /source3
parentb44cc7f07e38876a9a84db2c5614b62acc500c02 (diff)
downloadsamba-588c84d488289c069822ac87f645049f328afd1c.tar.gz
s3: libsmbclient: Ensure SMBC_getdents_ctx() also updates the readdirplus pointers.
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)
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/libsmb_dir.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c
index b51a4c13775..ff2948c9b69 100644
--- a/source3/libsmb/libsmb_dir.c
+++ b/source3/libsmb/libsmb_dir.c
@@ -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);