smbd: Fix DELETE_ON_CLOSE behaviour on files with READ_ONLY attribute
commit03518d2ff2cb8cf45052a3ddb710df2bf321881d
authorChristof Schmitt <cs@samba.org>
Fri, 2 Nov 2018 19:08:23 +0000 (2 12:08 -0700)
committerKarolin Seeger <kseeger@samba.org>
Wed, 7 Nov 2018 07:42:15 +0000 (7 08:42 +0100)
treed85867f607ae763fb42b1385698a56d412450e15
parent9603a098a16aabd01ce053a6b3119f757994e285
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>
(cherry picked from commit 162a5257c48f20d3752f644e86c9e626b46436c0)
selftest/knownfail
source3/smbd/open.c