summaryrefslogtreecommitdiffstats
path: root/source/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-02-28 13:14:54 -0800
committerKarolin Seeger <kseeger@samba.org>2009-03-06 08:28:27 +0100
commit8cf64375b9832e3300a7fdc3a1da570ee033d342 (patch)
tree21ee6d38cf91fccc659c98f1fcdbf072412e0020 /source/smbd
parenta452ff839d2afa79c7bf56451ad544b9a4b37612 (diff)
downloadsamba-8cf64375b9832e3300a7fdc3a1da570ee033d342.tar.gz
samba-8cf64375b9832e3300a7fdc3a1da570ee033d342.tar.xz
samba-8cf64375b9832e3300a7fdc3a1da570ee033d342.zip
Fix bug #6082 - smbd_gpfs_getacl failed: Windows client canĀ“t rename or
delete file (directory fix). Jeremy. (cherry picked from commit fc5765f843fbbe0a8c9ae6be6dc7658033d539d3)
Diffstat (limited to 'source/smbd')
-rw-r--r--source/smbd/open.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/smbd/open.c b/source/smbd/open.c
index 31679b539dd..9b51ff0d948 100644
--- a/source/smbd/open.c
+++ b/source/smbd/open.c
@@ -2462,6 +2462,25 @@ NTSTATUS open_directory(connection_struct *conn,
fname,
access_mask,
&access_granted);
+
+ /* Were we trying to do a directory open
+ * for delete and didn't get DELETE
+ * access (only) ? Check if the
+ * directory allows DELETE_CHILD.
+ * See here:
+ * http://blogs.msdn.com/oldnewthing/archive/2004/06/04/148426.aspx
+ * for details. */
+
+ if ((NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED) &&
+ (access_mask & DELETE_ACCESS) &&
+ (access_granted == DELETE_ACCESS) &&
+ can_delete_file_in_directory(conn, fname))) {
+ DEBUG(10,("open_directory: overrode ACCESS_DENIED "
+ "on directory %s\n",
+ fname ));
+ status = NT_STATUS_OK;
+ }
+
if (!NT_STATUS_IS_OK(status)) {
DEBUG(10, ("open_directory: check_open_rights on "
"file %s failed with %s\n",