summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-02-25 13:01:04 -0800
committerKarolin Seeger <kseeger@samba.org>2009-07-30 09:22:13 +0200
commit9fe089291df30035974b750b4da7e6fa20b9c8a5 (patch)
treee324dbe73b686074eb2e0e5990b7d295eae648f2 /source
parent3b6017fa7cae1a2cda488da0cc2dee7b08b63267 (diff)
downloadsamba-9fe089291df30035974b750b4da7e6fa20b9c8a5.tar.gz
samba-9fe089291df30035974b750b4da7e6fa20b9c8a5.tar.xz
samba-9fe089291df30035974b750b4da7e6fa20b9c8a5.zip
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. Make test for open modes more robust against other bits. Jeremy. (cherry picked from commit ac11d94f36e1878f3f5d86f2e7197fd8ecdd196b)
Diffstat (limited to 'source')
-rw-r--r--source/smbd/trans2.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/smbd/trans2.c b/source/smbd/trans2.c
index 904a84bef6d..d3b4fb9bb9e 100644
--- a/source/smbd/trans2.c
+++ b/source/smbd/trans2.c
@@ -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 ));