svn commit: samba r4410 - in branches/SAMBA_4_0/source/ntvfs/posix: .

tridge at samba.org tridge at samba.org
Thu Dec 30 06:37:38 GMT 2004


Author: tridge
Date: 2004-12-30 06:37:37 +0000 (Thu, 30 Dec 2004)
New Revision: 4410

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4410

Log:
pvfs_rename_one() should not check for create permissions, as the rename
is always in the same directory


Modified:
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_rename.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_rename.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_rename.c	2004-12-30 06:02:54 UTC (rev 4409)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_rename.c	2004-12-30 06:37:37 UTC (rev 4410)
@@ -141,21 +141,18 @@
 	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 @@
 	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 @@
 		return pvfs_map_errno(pvfs, errno);
 	}
 
+failed:
 	talloc_free(mem_ctx);
-
-	return NT_STATUS_OK;
+	return status;
 }
 
 



More information about the samba-cvs mailing list