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>
Fri, 6 Mar 2009 07:28:25 +0000 (08:28 +0100)
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)

source/smbd/trans2.c

index fdca880144d7242adb93efd34839b332c8c665ee..2fb0922511ebdd54c811b19ce101e53d78060306 100644 (file)
@@ -6382,6 +6382,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 ));