Re-fix bug 5202 - cannot change ACLs on writable file with "dos filemode=yes"
commit5eec35292802b55fb29f3016627f0ec767db7df0
authorJeremy Allison <jra@samba.org>
Fri, 8 Jan 2010 18:22:46 +0000 (8 10:22 -0800)
committerKarolin Seeger <kseeger@samba.org>
Mon, 18 Jan 2010 11:33:07 +0000 (18 12:33 +0100)
tree1e493085bcbeb82c112aa0171460c89ebba16ac0
parented275341a97a4e996aa1dcfa8a8812fd223d6efc
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 f04a8d1811c1099eb653efda314bc98553fa6d02)
source3/smbd/posix_acls.c