Fix error code when smbclient puts a file over an existing directory
commit03a7ad239908bea5d0e2e6fb62cddc0f02aa1da4
authorVolker Lendecke <vl@sernet.de>
Sat, 13 Dec 2008 21:14:58 +0000 (13 13:14 -0800)
committerKarolin Seeger <kseeger@samba.org>
Wed, 28 Jan 2009 08:39:45 +0000 (28 09:39 +0100)
treef7fcd0b43d37b8540887f48a1c870a2a251479aa
parent59e6cce7f3e117d055ff4bfdf98e1296317091df
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 73039cd49521e724a8351a353e9ae1d342be1352)
source/smbd/open.c