s3:smbd: only try and fallback to open a directory if it's not a stream open
authorStefan Metzmacher <metze@samba.org>
Wed, 26 Nov 2008 13:04:08 +0000 (14:04 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 26 Nov 2008 22:02:23 +0000 (23:02 +0100)
metze

source/smbd/open.c

index b20927cd82100198b3408c85ece3b8bc80a67a67..c4b244fdb07d36ffe8eecda5738e5c78a7d2ae22 100644 (file)
@@ -2826,6 +2826,13 @@ NTSTATUS create_file_unixpath(connection_struct *conn,
 
                if (NT_STATUS_EQUAL(status, NT_STATUS_FILE_IS_A_DIRECTORY)) {
 
+                       /* A stream open never opens a directory */
+
+                       if (base_fsp) {
+                               status = NT_STATUS_FILE_IS_A_DIRECTORY;
+                               goto fail;
+                       }
+
                        /*
                         * Fail the open if it was explicitly a non-directory
                         * file.