shadow_copy2: The system getrealfilename() can't deal with a 0-length fname
authorVolker Lendecke <vl@samba.org>
Tue, 30 Jun 2009 12:26:32 +0000 (14:26 +0200)
committerVolker Lendecke <vl@samba.org>
Wed, 29 Jul 2009 10:28:50 +0000 (06:28 -0400)
This fixes viewing the content of snapshots in the share root directory. We
have to treat the filename that *just* consists of "@GMT-YYYY.MM.DD-HH.MM.SS"
like the share root, which is the current working directory.

source3/modules/vfs_shadow_copy2.c

index 5efae3b0edcf6b392de9e027dc4a110b0d0ca4cb..eac83fca7499e01d7be883a0ecbe953919aee2f7 100644 (file)
@@ -476,6 +476,9 @@ static int shadow_copy2_mknod(vfs_handle_struct *handle,
 static char *shadow_copy2_realpath(vfs_handle_struct *handle,
                            const char *fname, char *resolved_path)
 {
+       if (shadow_copy2_match_name(fname) && (fname[GMT_NAME_LEN] == '\0')) {
+               return SMB_VFS_NEXT_REALPATH(handle, ".", resolved_path);
+       }
         SHADOW2_NEXT(REALPATH, (handle, name, resolved_path), char *, NULL);
 }