diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-12-30 06:37:37 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:07:44 -0500 |
commit | 4f16988ead0684daa4d2ffef01e7b6f61eb83f81 (patch) | |
tree | 934995b67d07c8368cfe78edb77ae8b2f4892945 /source4/ntvfs/posix | |
parent | 91190fdad861077d0c33bf85f8fd284f69e3e3fe (diff) | |
download | samba-4f16988ead0684daa4d2ffef01e7b6f61eb83f81.tar.gz samba-4f16988ead0684daa4d2ffef01e7b6f61eb83f81.tar.bz2 samba-4f16988ead0684daa4d2ffef01e7b6f61eb83f81.zip |
r4410: pvfs_rename_one() should not check for create permissions, as the rename
is always in the same directory
(This used to be commit babf3480a4c29ce28d9a4525c4174a3d765dcbab)
Diffstat (limited to 'source4/ntvfs/posix')
-rw-r--r-- | source4/ntvfs/posix/pvfs_rename.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/source4/ntvfs/posix/pvfs_rename.c b/source4/ntvfs/posix/pvfs_rename.c index 9fe92c9173..f8d0ba1c27 100644 --- a/source4/ntvfs/posix/pvfs_rename.c +++ b/source4/ntvfs/posix/pvfs_rename.c @@ -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; } |