From 7140792b54de7f692cfd10c0563d48c5c6d6d727 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 25 Feb 2009 13:00:21 -0800 Subject: [PATCH] Make test for open modes more robust against other bits. Jeremy. (cherry picked from commit 8d178837f259757340a09a688ed194e3e4a92c36) (cherry picked from commit 6631ca4a51d4b13d2edd2dc899f7b76c233825b5) (cherry picked from commit a7f96104b957ba0eb910f8c0073818f872345e3c) --- source/smbd/trans2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/smbd/trans2.c b/source/smbd/trans2.c index 5b182df8208..25b0c1304b2 100644 --- a/source/smbd/trans2.c +++ b/source/smbd/trans2.c @@ -6362,7 +6362,7 @@ 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) { + } 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", -- 2.11.4.GIT