Re-fix bug 5202 - cannot change ACLs on writable file with "dos filemode=yes"
authorJeremy Allison <jra@samba.org>
Fri, 8 Jan 2010 18:24:34 +0000 (10:24 -0800)
committerKarolin Seeger <kseeger@samba.org>
Wed, 13 Jan 2010 13:01:05 +0000 (14:01 +0100)
commit31d45ea2091222fac27b82df7e69fdd5bbe375d6
tree1727fe7a61f710356188116ff116a2a3e8326460
parent26bb48ec4d14addbf915d80bbec5656dc0fff155
Re-fix bug 5202 - cannot change ACLs on writable file with "dos filemode=yes"

This bug re-occurred for 3.3.x and above.

The reason is that to change a NT ACL we now have to open the file requesting
WRITE_DAC and WRITE_OWNER access. The mapping from POSIX "w" to NT permissions
in posix_acls doesn't add these bits when "dos filemode = yes", so even though
the permission or owner change would be allowed by the POSIX ACL code, the
NTCreateX call fails with ACCESS_DENIED now we always check NT permissions
first.

Added in the mapping from "w" to WRITE_DAC and WRITE_OWNER access.

Jeremy.
(cherry picked from commit 9bd957580360ed7a0f98b02d1e03d7fcaf8a878e)
source/smbd/posix_acls.c