From: Jeremy Allison Date: Wed, 25 Feb 2009 20:54:58 +0000 (-0800) Subject: Fix bug in processing of open modes in POSIX open. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2050a239a5fee6cfd17d083619cc4a03a3a6dd6d;p=thirdparty%2Fsamba.git Fix bug in processing of open modes in POSIX open. Was missing case of "If file exists open. If file doesn't exist error." Damn damn damn. CIFSFS client will have to have fallback cases for this error for a long time. Jeremy. (cherry picked from commit b652082648c49b525d2b2ce619b575ee75bc242e) (cherry picked from commit 12cf12f10c1c6adad568daf6c16144a99b0f822e) --- diff --git a/source/smbd/trans2.c b/source/smbd/trans2.c index 31fd18d6e3d..5b182df8208 100644 --- a/source/smbd/trans2.c +++ b/source/smbd/trans2.c @@ -6362,6 +6362,8 @@ static NTSTATUS smb_posix_open(connection_struct *conn, create_disp = FILE_OVERWRITE_IF; } else if((wire_open_mode & SMB_O_CREAT) == SMB_O_CREAT) { create_disp = FILE_OPEN_IF; + } else if (wire_open_mode == 0) { + create_disp = FILE_OPEN; } else { DEBUG(5,("smb_posix_open: invalid create mode 0x%x\n", (unsigned int)wire_open_mode ));