Fix bug in processing of open modes in POSIX open.
authorJeremy Allison <jra@samba.org>
Wed, 25 Feb 2009 20:54:58 +0000 (12:54 -0800)
committerKarolin Seeger <kseeger@samba.org>
Tue, 2 Jun 2009 10:41:56 +0000 (12:41 +0200)
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)
(cherry picked from commit 2050a239a5fee6cfd17d083619cc4a03a3a6dd6d)

source/smbd/trans2.c

index 31fd18d6e3d658a06774022e4bfb8d10bd567e35..5b182df82086d4766a7afe8b856f75c4f03d1e97 100644 (file)
@@ -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 ));