s3: vfs: dirsort doesn't handle opendir of "." correctly.
authorJeremy Allison <jra@samba.org>
Thu, 5 Jan 2017 20:38:07 +0000 (12:38 -0800)
committerJeremy Allison <jra@samba.org>
Mon, 9 Jan 2017 18:31:19 +0000 (19:31 +0100)
Needs to store $cwd path for correct sorting.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12499

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
source3/modules/vfs_dirsort.c

index f8568353bd9048bd14302d2916a9709bf5705e42..4a3e152039f16464c60f1ea76cebe92ef38dd0d5 100644 (file)
@@ -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);