summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2019-08-26 10:02:47 -0700
committerKarolin Seeger <kseeger@samba.org>2019-09-19 07:04:30 +0000
commitb44cc7f07e38876a9a84db2c5614b62acc500c02 (patch)
treebde49b6387aabf973bd08db51bd824dfe3bcda73
parent04cb3d3ee138c8ec943a5424c82fa7ff47203703 (diff)
downloadsamba-b44cc7f07e38876a9a84db2c5614b62acc500c02.tar.gz
s3: libsmbclient: Ensure SMBC_readdirplus_ctx() also updates the readdir pointers.
If we are returning file entries, we have a duplicate list in dir_list. Update dir_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 3d82b7d11cd7b78adc6b3642e64e3a8f251de869)
-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 35215fdfbb5..b51a4c13775 100644
--- a/source3/libsmb/libsmb_dir.c
+++ b/source3/libsmb/libsmb_dir.c
@@ -1230,6 +1230,17 @@ SMBC_readdirplus_ctx(SMBCCTX *context,
}
dir->dirplus_next = dir->dirplus_next->next;
+ /*
+ * If we are returning file entries, we
+ * have a duplicate list in dir_list
+ *
+ * Update dir_next also so readdir and
+ * readdirplus are kept in sync.
+ */
+ if (dir->dir_list) {
+ dir->dir_next = dir->dir_next->next;
+ }
+
TALLOC_FREE(frame);
return smb_finfo;
}