Author: jra
Date: 2006-01-16 05:47:43 +0000 (Mon, 16 Jan 2006)
New Revision: 12957

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

Log:
Fix for bug #3035 from SATOH Fumiyasu <[EMAIL PROTECTED]>

On a Windows share, a file with read-only dosmode can be opened with
DELETE_ACCESS. But on a Samba share (delete readonly = no), it
fails with NT_STATUS_CANNOT_DELETE error.

This semantic causes a problem that a user can not
rename a file with read-only dosmode on a Samba share
from a Windows command prompt (i.e. cmd.exe, but can rename
from Windows Explorer).

Jeremy.

Modified:
   trunk/source/smbd/reply.c


Changeset:
Modified: trunk/source/smbd/reply.c
===================================================================
--- trunk/source/smbd/reply.c   2006-01-16 05:47:39 UTC (rev 12956)
+++ trunk/source/smbd/reply.c   2006-01-16 05:47:43 UTC (rev 12957)
@@ -1888,7 +1888,19 @@
                return NT_STATUS_OBJECT_NAME_INVALID;
 #endif /* JRATEST */
 
-       if (!lp_delete_readonly(SNUM(conn))) {
+       /* Fix for bug #3035 from SATOH Fumiyasu <[EMAIL PROTECTED]>
+
+         On a Windows share, a file with read-only dosmode can be opened with
+         DELETE_ACCESS. But on a Samba share (delete readonly = no), it
+         fails with NT_STATUS_CANNOT_DELETE error.
+
+         This semantic causes a problem that a user can not
+         rename a file with read-only dosmode on a Samba share
+         from a Windows command prompt (i.e. cmd.exe, but can rename
+         from Windows Explorer).
+       */
+
+       if (!check_is_at_open && !lp_delete_readonly(SNUM(conn))) {
                if (fattr & aRONLY) {
                        return NT_STATUS_CANNOT_DELETE;
                }

Reply via email to