From 9ab4c9eb7fc037430dbdfc7cbf8defc778b6aaa4 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 5 Jan 2017 12:38:07 -0800 Subject: [PATCH] s3: vfs: dirsort doesn't handle opendir of "." correctly. Needs to store $cwd path for correct sorting. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12499 Signed-off-by: Jeremy Allison Reviewed-by: Uri Simchoni (cherry picked from commit e2f34116ab6328e2b872999dc7c4bcda69c03ab2) --- source3/modules/vfs_dirsort.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source3/modules/vfs_dirsort.c b/source3/modules/vfs_dirsort.c index f8568353bd9..4a3e152039f 100644 --- a/source3/modules/vfs_dirsort.c +++ b/source3/modules/vfs_dirsort.c @@ -138,6 +138,10 @@ static DIR *dirsort_opendir(vfs_handle_struct *handle, return NULL; } + if (ISDOT(data->smb_fname->base_name)) { + data->smb_fname->base_name = vfs_GetWd(data, handle->conn); + } + /* Open the underlying directory and count the number of entries */ data->source_directory = SMB_VFS_NEXT_OPENDIR(handle, smb_fname, mask, attr); -- 2.11.0.483.g087da7b7c-goog