s3-shadow-copy2: Fix incorrect case submounts
authorVolker Lendecke <vl@samba.org>
Wed, 17 Oct 2012 10:08:26 +0000 (12:08 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 27 Jun 2014 04:49:10 +0000 (06:49 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
source3/modules/vfs_shadow_copy2.c

index 029b1552089c9683b6a3b92b75039e87c910a031..e7a8a9d13752337f3007dc5b08244e1dab8de5b3 100644 (file)
@@ -472,8 +472,12 @@ static char *shadow_copy2_convert(TALLOC_CTX *mem_ctx,
                /* never reached ... */
        }
 
-       path = talloc_asprintf(mem_ctx, "%s/%s", handle->conn->connectpath,
-                              name);
+       if (name[0] == 0) {
+               path = talloc_strdup(mem_ctx, handle->conn->connectpath);
+       } else {
+               path = talloc_asprintf(
+                       mem_ctx, "%s/%s", handle->conn->connectpath, name);
+       }
        if (path == NULL) {
                errno = ENOMEM;
                goto fail;
@@ -1677,14 +1681,6 @@ static int shadow_copy2_get_real_filename(struct vfs_handle_struct *handle,
                return SMB_VFS_NEXT_GET_REAL_FILENAME(handle, path, name,
                                                      mem_ctx, found_name);
        }
-       if (stripped[0] == '\0') {
-               *found_name = talloc_strdup(mem_ctx, name);
-               if (*found_name == NULL) {
-                       errno = ENOMEM;
-                       return -1;
-               }
-               return 0;
-       }
        conv = shadow_copy2_convert(talloc_tos(), handle, stripped, timestamp);
        TALLOC_FREE(stripped);
        if (conv == NULL) {