Fix error code when smbclient puts a file over an existing directory
commit150c16821ba4d66a81de1716b78c4d59bd8d8dd4
authorVolker Lendecke <vl@sernet.de>
Fri, 12 Dec 2008 12:47:41 +0000 (12 13:47 +0100)
committerKarolin Seeger <kseeger@samba.org>
Fri, 12 Dec 2008 16:55:05 +0000 (12 17:55 +0100)
treea61a39127f776b83c45aff7d3e9dbb57f2267c68
parentd6d326e3de830259dfc0af66f2bc7414145fecd1
Fix error code when smbclient puts a file over an existing directory

Windows returns NT_STATUS_FILE_IS_A_DIRECTORY, as does Samba 3.0. 3.2 and
following returned NT_STATUS_INVALID_PARAMETER which is wrong.

Before I converted reply_open_and_X to create_file() we called
open_file_ntcreate directly. Passing through open&X for a filename that exists
as a directory ends up in open_directory after having tried open_file_ntcreate.
Some check in there returns NT_STATUS_INVALID_PARAMETER. With this additional
FILE_NON_DIRECTORY_FILE flag we get the correct error message back from
create_file_unixpath before trying open_directory().

Survives make test, but as this also touches the other open variants I would
like others to review this.

Volker
(cherry picked from commit fc4366ca11cac97819eb06a744cf8e35b4524bcc)
source/smbd/open.c