svn commit: samba r5510 - in branches/SAMBA_3_0/source/smbd: .

jra at samba.org jra at samba.org
Tue Feb 22 20:55:49 GMT 2005


Author: jra
Date: 2005-02-22 20:55:48 +0000 (Tue, 22 Feb 2005)
New Revision: 5510

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

Log:
Optimisation to only do can_delete check if client asks for FILE_SHARE_DELETE.
Not completely correct but will catch the XP SP2 problem.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/smbd/nttrans.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/nttrans.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/nttrans.c	2005-02-22 20:55:17 UTC (rev 5509)
+++ branches/SAMBA_3_0/source/smbd/nttrans.c	2005-02-22 20:55:48 UTC (rev 5510)
@@ -780,7 +780,16 @@
 		}
 	}
 
+#if 0
+	/* This is the correct thing to do (check every time) but can_delete is
+	   expensive (it may have to read the parent directory permissions). So
+	   for now we're not doing it unless we have a strong hint the client
+	   is really going to delete this file. */
 	if (desired_access & DELETE_ACCESS) {
+#else
+	/* Setting FILE_SHARE_DELETE is the hint. */
+	if ((share_access & FILE_SHARE_DELETE) && (desired_access & DELETE_ACCESS)) {
+#endif
 		status = can_delete(conn, fname, file_attributes, bad_path, True);
 		/* We're only going to fail here if it's access denied, as that's the
 		   only error we care about for "can we delete this ?" questions. */



More information about the samba-cvs mailing list