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 */
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) {
return pvfs_map_errno(pvfs, errno);
}
+failed:
talloc_free(mem_ctx);
-
- return NT_STATUS_OK;
+ return status;
}