From 7bd393f2338b4c6e84ebff55fd567ae840108c06 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 28 May 1999 19:18:23 +0000 Subject: 99.9999999% sure this is the correct fix for the directory open bugs. I finally noticed in the Lotus Notes capture file that the "FILE_NON_DIRECTORY" flag was being set in create options for a open on a directory that should fail. All the other heuristics were incorrect. Jeremy. --- source/smbd/nttrans.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/source/smbd/nttrans.c b/source/smbd/nttrans.c index 6838b9c0f0f..aff1195dc92 100644 --- a/source/smbd/nttrans.c +++ b/source/smbd/nttrans.c @@ -784,13 +784,10 @@ int reply_ntcreate_and_X(connection_struct *conn, if(errno == EISDIR) { /* - * We only fall back to directory open if no oplock was - * requested and no read/write data was requested. + * Fail the open if it was explicitly a non-directory file. */ - if(oplock_request || (desired_access & (FILE_READ_DATA|FILE_WRITE_DATA| - FILE_APPEND_DATA|FILE_READ_ATTRIBUTES|FILE_READ_EA| - FILE_WRITE_ATTRIBUTES|FILE_WRITE_EA))) { + if (create_options & FILE_NON_DIRECTORY_FILE) { SSVAL(outbuf, smb_flg2, FLAGS2_32_BIT_ERROR_CODES); return(ERROR(0, 0xc0000000|NT_STATUS_FILE_IS_A_DIRECTORY)); } -- cgit v1.2.1