diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-10-12 05:07:33 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:59:48 -0500 |
commit | c7130b816b29cab981646482e57cb6923ae91b4f (patch) | |
tree | 50fa768d10e78d5d6b960ab34a384e15e615dbb3 /source4/ntvfs | |
parent | 08edfb328334fdfe0c5d968e97a6a693e29ff602 (diff) | |
download | samba-c7130b816b29cab981646482e57cb6923ae91b4f.tar.gz samba-c7130b816b29cab981646482e57cb6923ae91b4f.tar.bz2 samba-c7130b816b29cab981646482e57cb6923ae91b4f.zip |
r2926: name->dos.attrib is not valid unless name->exists is true
(This used to be commit f85a0b725d3bf67531e6874d4e8558fb050bb66f)
Diffstat (limited to 'source4/ntvfs')
-rw-r--r-- | source4/ntvfs/posix/pvfs_open.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c index 271bd41429..29e57e5a08 100644 --- a/source4/ntvfs/posix/pvfs_open.c +++ b/source4/ntvfs/posix/pvfs_open.c @@ -110,12 +110,14 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs, #define O_DIRECTORY 0 #endif - if ((io->generic.in.create_options & NTCREATEX_OPTIONS_DIRECTORY) && + if (name->exists && + (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) { + if ((name->exists && name->dos.attrib & FILE_ATTRIBUTE_DIRECTORY) || + (io->generic.in.create_options & NTCREATEX_OPTIONS_DIRECTORY)) { flags = O_RDONLY | O_DIRECTORY; if (pvfs->flags & PVFS_FLAG_READONLY) { goto do_open; |