summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-11 14:35:54 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:48 -0500
commit4d69d2d52b273359b481e1a7b99b9db3711d2768 (patch)
tree9297e9c67e2c379a22a82e516b060c9bddaab9b6 /source4
parent8caf54869e43db82a2d4294d04ea8e20a63ccbf5 (diff)
downloadsamba-4d69d2d52b273359b481e1a7b99b9db3711d2768.tar.gz
samba-4d69d2d52b273359b481e1a7b99b9db3711d2768.tar.bz2
samba-4d69d2d52b273359b481e1a7b99b9db3711d2768.zip
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. (This used to be commit 4a8b0302eff37ccfcb66b91259ee5da20879c652)
Diffstat (limited to 'source4')
-rw-r--r--source4/ntvfs/posix/pvfs_open.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c
index 560d194a34..271bd41429 100644
--- a/source4/ntvfs/posix/pvfs_open.c
+++ b/source4/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;