diff options
author | Jeremy Allison <jra@samba.org> | 2013-02-12 10:48:09 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2013-02-12 22:59:21 +0100 |
commit | fa3924f9ea656c279d430212b4b2a667bf5227f8 (patch) | |
tree | b983343cc1cb52fbc2d2edc37cbd40b9c53a0c26 /source3 | |
parent | efd60aeff7aac308d85b767cdf394dd866cce078 (diff) | |
download | samba-fa3924f9ea656c279d430212b4b2a667bf5227f8.tar.gz samba-fa3924f9ea656c279d430212b4b2a667bf5227f8.tar.bz2 samba-fa3924f9ea656c279d430212b4b2a667bf5227f8.zip |
Fix bug 9519 - Samba returns unexpected error on SMB posix open.
Explicitly ignore bare O_EXCL flags instead of returning INVALID_PARAMETER.
That's what the Linux kernel does.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Jeff Layton <jlayton@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Feb 12 22:59:21 CET 2013 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/trans2.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 8cffc15dec..fae9e1ff9d 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -7412,12 +7412,19 @@ static NTSTATUS smb_posix_open(connection_struct *conn, /* File exists open. File not exist create. */ create_disp = FILE_OPEN_IF; break; + case SMB_O_EXCL: + /* O_EXCL on its own without O_CREAT is undefined. + We deliberately ignore it as some versions of + Linux CIFSFS can send a bare O_EXCL on the + wire which other filesystems in the kernel + ignore. See bug 9519 for details. */ + + /* Fallthrough. */ + case 0: /* File exists open. File not exist fail. */ create_disp = FILE_OPEN; break; - case SMB_O_EXCL: - /* O_EXCL on its own without O_CREAT is undefined. */ default: DEBUG(5,("smb_posix_open: invalid create mode 0x%x\n", (unsigned int)wire_open_mode )); |