Author: jra Date: 2005-10-05 22:41:16 +0000 (Wed, 05 Oct 2005) New Revision: 10744
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10744 Log: Fix for the second incarnation of bug #3088, pushed by Alex Masterov <[EMAIL PROTECTED]>. 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. Modified: branches/SAMBA_3_0/source/smbd/open.c Changeset: Modified: branches/SAMBA_3_0/source/smbd/open.c =================================================================== --- branches/SAMBA_3_0/source/smbd/open.c 2005-10-05 22:40:52 UTC (rev 10743) +++ branches/SAMBA_3_0/source/smbd/open.c 2005-10-05 22:41:16 UTC (rev 10744) @@ -1507,22 +1507,6 @@ 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);