Fix bug in processing of open modes in POSIX open.
authorJeremy Allison <jra@samba.org>
Wed, 25 Feb 2009 21:01:04 +0000 (13:01 -0800)
committerJeremy Allison <jra@samba.org>
Wed, 25 Feb 2009 21:01:04 +0000 (13:01 -0800)
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.

Make test for open modes more robust against other bits.

Jeremy.

source/smbd/trans2.c

index 904a84bef6d5748efd7087e41b5ae4203bcfb4ee..d3b4fb9bb9e148794ddbec086ac75bc5dc726807 100644 (file)
@@ -5463,6 +5463,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 & (SMB_O_CREAT | SMB_O_EXCL | SMB_O_TRUNC)) == 0) {
+               create_disp = FILE_OPEN;
        } else {
                DEBUG(5,("smb_posix_open: invalid create mode 0x%x\n",
                        (unsigned int)wire_open_mode ));