From 94fe079be747ea5899f483dd8d00fdd247de4e33 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 5 Oct 2005 22:41:16 +0000 Subject: [PATCH] r10744: Fix for the second incarnation of bug #3088, pushed by Alex Masterov . A fcbopen specific part of the code was erroneously being called as part of the mainline open. Note, that this patch superceeds and replaces the fix that Volker added for this bug (which he added a Samba4 torture test for ) : "Fix a race condition in Samba 3. If two files are opened simultaneously with NTCREATEX_DISP_CREATE (create if not exists, else fail) they might end up with two or more times NT_STATUS_OK as EEXIST is not correctly handled." Jeremy. (This used to be commit 5d7ab9a17e793c05409a16675ac2aa2861c4f89e) --- source3/smbd/open.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 56d31c69409..a8fb8ed38f7 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1507,22 +1507,6 @@ files_struct *open_file_ntcreate(connection_struct *conn, fsp_open = open_file(fsp,conn,fname,psbuf,flags|flags2,unx_mode, access_mask); - if (!fsp_open && (flags2 & O_EXCL) && (errno == EEXIST)) { - /* - * Two smbd's tried to open exclusively, but only one of them - * succeeded. - */ - file_free(fsp); - return NULL; - } - - if (!fsp_open && (flags == O_RDWR) && (errno != ENOENT)) { - if((fsp_open = open_file(fsp,conn,fname,psbuf, - O_RDONLY,unx_mode,access_mask)) == True) { - flags = O_RDONLY; - } - } - if (!fsp_open) { if (lck != NULL) { talloc_free(lck); -- 2.11.4.GIT