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

tridge at samba.org tridge at samba.org
Mon Oct 25 05:27:15 GMT 2004


Author: tridge
Date: 2004-10-25 05:27:15 +0000 (Mon, 25 Oct 2004)
New Revision: 3192

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/ntvfs/posix&rev=3192&nolog=1

Log:
make sure we don't call pvfs_can_delete() until after we have confirmed that name->exists
it true

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-10-25 05:26:23 UTC (rev 3191)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_rename.c	2004-10-25 05:27:15 UTC (rev 3192)
@@ -48,16 +48,6 @@
 		return status;
 	}
 
-	status = pvfs_can_delete(pvfs, name1);
-	if (!NT_STATUS_IS_OK(status)) {
-		return status;
-	}
-
-	status = pvfs_can_delete(pvfs, name2);
-	if (!NT_STATUS_IS_OK(status)) {
-		return status;
-	}
-
 	if (name1->has_wildcard || name2->has_wildcard) {
 		DEBUG(3,("Rejecting wildcard rename '%s' -> '%s'\n", 
 			 ren->rename.in.pattern1, ren->rename.in.pattern2));
@@ -72,6 +62,11 @@
 		return NT_STATUS_OBJECT_NAME_COLLISION;
 	}
 
+	status = pvfs_can_delete(pvfs, name1);
+	if (!NT_STATUS_IS_OK(status)) {
+		return status;
+	}
+
 	if (rename(name1->full_name, name2->full_name) == -1) {
 		return pvfs_map_errno(pvfs, errno);
 	}



More information about the samba-cvs mailing list