pvfs_open: return FILE_IS_A_DIRECTORY when opening a stream on a directory
authorStefan Metzmacher <metze@samba.org>
Fri, 23 May 2008 07:47:59 +0000 (09:47 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 23 May 2008 07:55:15 +0000 (09:55 +0200)
metze
(This used to be commit 1421b1cc0c442be839be702647009ed5295f34a3)

source4/ntvfs/posix/pvfs_open.c

index cc4f0add27ccc96427b6e7f973dd21a0040517bf..926c99d37ed0c807fc20aa6eea5996e69d625a95 100644 (file)
@@ -182,12 +182,19 @@ static NTSTATUS pvfs_open_directory(struct pvfs_state *pvfs,
        bool del_on_close;
        uint32_t create_options;
        uint32_t share_access;
+       bool forced;
 
        create_options = io->generic.in.create_options;
        share_access   = io->generic.in.share_access;
 
+       forced = (io->generic.in.create_options & NTCREATEX_OPTIONS_DIRECTORY)?true:false;
+
        if (name->stream_name) {
-               return NT_STATUS_NOT_A_DIRECTORY;
+               if (forced) {
+                       return NT_STATUS_NOT_A_DIRECTORY;
+               } else {
+                       return NT_STATUS_FILE_IS_A_DIRECTORY;
+               }
        }
 
        /* if the client says it must be a directory, and it isn't,