From: Andrew Tridgell Date: Mon, 11 Oct 2004 14:35:54 +0000 (+0000) Subject: r2916: longhorn client doesn't bother setting the directory bit in ntcreatex X-Git-Tag: samba-misc-tags/initial-v4-0-unstable~11485 X-Git-Url: http://git.samba.org/?p=samba.git;a=commitdiff_plain;h=4a8b0302eff37ccfcb66b91259ee5da20879c652;hp=9560a6c8cc650c3a519b14c79f497e6bd9ef387e;ds=sidebyside r2916: longhorn client doesn't bother setting the directory bit in ntcreatex when opening directories. This change allows samba4 server to work with longhorn client. --- diff --git a/source/ntvfs/posix/pvfs_open.c b/source/ntvfs/posix/pvfs_open.c index 560d194a346..271bd414295 100644 --- a/source/ntvfs/posix/pvfs_open.c +++ b/source/ntvfs/posix/pvfs_open.c @@ -110,7 +110,12 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs, #define O_DIRECTORY 0 #endif - if (io->generic.in.create_options & NTCREATEX_OPTIONS_DIRECTORY) { + if ((io->generic.in.create_options & NTCREATEX_OPTIONS_DIRECTORY) && + !(name->dos.attrib & FILE_ATTRIBUTE_DIRECTORY)) { + return NT_STATUS_NOT_A_DIRECTORY; + } + + if (name->dos.attrib & FILE_ATTRIBUTE_DIRECTORY) { flags = O_RDONLY | O_DIRECTORY; if (pvfs->flags & PVFS_FLAG_READONLY) { goto do_open;