]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: vfs: dirsort doesn't handle opendir of "." correctly.
authorJeremy Allison <jra@samba.org>
Fri, 27 Jan 2017 17:09:56 +0000 (09:09 -0800)
committerKarolin Seeger <kseeger@samba.org>
Tue, 7 Feb 2017 08:36:24 +0000 (09:36 +0100)
Needs to store $cwd path for correct sorting.

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

Back-port from commit e2f34116ab6328e2b872999dc7c4bcda69c03ab2.

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

index d1640880e7180c6423ab0b1b7223b3c8cd5db145..0e923e61706edc366c0dd3ddc7d0319fe1f2d9b5 100644 (file)
@@ -137,6 +137,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, fname, mask,
                                                      attr);