From 2dd7fd8f69ea06ad234c3354493052ef5a147c03 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 16 Jan 2006 05:47:39 +0000 Subject: r12956: Fix for bug #3035 from SATOH Fumiyasu 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. (This used to be commit dd185c7aa8de156dab58b065bf73905b2a29f40d) --- source3/smbd/reply.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index d56e3c1f1c..69c71c74b5 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -1888,7 +1888,19 @@ NTSTATUS can_delete(connection_struct *conn, char *fname, uint32 dirtype, BOOL b return NT_STATUS_OBJECT_NAME_INVALID; #endif /* JRATEST */ - if (!lp_delete_readonly(SNUM(conn))) { + /* Fix for bug #3035 from SATOH Fumiyasu + + 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; } -- cgit