diff options
author | Jeremy Allison <jra@samba.org> | 2019-08-26 09:54:06 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2019-09-03 16:15:36 +0000 |
commit | 4bca8e097f5a909c628daa4dbfa932ddc1725ebc (patch) | |
tree | 048781860e8f57cf7a1c7343dbcc7fe9cec3f115 /source3/libsmb | |
parent | efd4832c2cfc4092bafb93dd4caf32d04488919f (diff) | |
download | samba-4bca8e097f5a909c628daa4dbfa932ddc1725ebc.tar.gz |
s3: libsmbclient: Ensure SMBC_readdir_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>
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/libsmb_dir.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c index 886aa626509..a3ec9a8ff71 100644 --- a/source3/libsmb/libsmb_dir.c +++ b/source3/libsmb/libsmb_dir.c @@ -1174,6 +1174,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; } |