smbd: Fix DELETE_ON_CLOSE behaviour on files with READ_ONLY attribute
authorChristof Schmitt <cs@samba.org>
Fri, 2 Nov 2018 19:08:23 +0000 (12:08 -0700)
committerChristof Schmitt <cs@samba.org>
Sat, 3 Nov 2018 02:01:25 +0000 (03:01 +0100)
commit162a5257c48f20d3752f644e86c9e626b46436c0
treef30abf61d327922c72ed919948e03ad2fe409ba2
parentdc9bbbe4141d8425e66fe9290ff611845f4bd1ce
smbd: Fix DELETE_ON_CLOSE behaviour on files with READ_ONLY attribute

MS-FSA states that a CREATE with FILE_DELETE_ON_CLOSE on an existing
file with READ_ONLY attribute has to return STATUS_CANNOT_DELETE. This
was missing in smbd as the check used the DOS attributes from the CREATE
instead of the DOS attributes on the existing file.

We need to handle the new file and existing file cases separately.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13673

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
selftest/knownfail
source3/smbd/open.c