r4410: pvfs_rename_one() should not check for create permissions, as the rename
authorAndrew Tridgell <tridge@samba.org>
Thu, 30 Dec 2004 06:37:37 +0000 (06:37 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:07:44 +0000 (13:07 -0500)
is always in the same directory
(This used to be commit babf3480a4c29ce28d9a4525c4174a3d765dcbab)

source4/ntvfs/posix/pvfs_rename.c

index 9fe92c917389283e3f46b2301f89ce240e78ab01..f8d0ba1c279a9ca06ce621120685dcaf0e11d117 100644 (file)
@@ -141,21 +141,18 @@ static NTSTATUS pvfs_rename_one(struct pvfs_state *pvfs,
        status = pvfs_resolve_partial(pvfs, mem_ctx, 
                                      dir_path, fname1, &name1);
        if (!NT_STATUS_IS_OK(status)) {
-               talloc_free(mem_ctx);
-               return status;
+               goto failed;
        }
 
        /* make sure its matches the given attributes */
        status = pvfs_match_attrib(pvfs, name1, attrib, 0);
        if (!NT_STATUS_IS_OK(status)) {
-               talloc_free(mem_ctx);
-               return status;
+               goto failed;
        }
 
        status = pvfs_can_rename(pvfs, name1);
        if (!NT_STATUS_IS_OK(status)) {
-               talloc_free(mem_ctx);
-               return status;
+               goto failed;
        }
 
        /* get a pvfs_filename dest object */
@@ -164,15 +161,11 @@ static NTSTATUS pvfs_rename_one(struct pvfs_state *pvfs,
        if (NT_STATUS_IS_OK(status)) {
                status = pvfs_can_delete(pvfs, req, name2);
                if (!NT_STATUS_IS_OK(status)) {
-                       talloc_free(mem_ctx);
-                       return status;
+                       goto failed;
                }
        }
 
-       status = pvfs_access_check_create(pvfs, req, name2);
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       status = NT_STATUS_OK;
 
        fname2 = talloc_asprintf(mem_ctx, "%s/%s", dir_path, fname2);
        if (fname2 == NULL) {
@@ -184,9 +177,9 @@ static NTSTATUS pvfs_rename_one(struct pvfs_state *pvfs,
                return pvfs_map_errno(pvfs, errno);
        }
 
+failed:
        talloc_free(mem_ctx);
-
-       return NT_STATUS_OK;
+       return status;
 }