]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Added fix for file descriptor re-use failing when
authorSamba Release Account <samba-bugs@samba.org>
Thu, 23 Jan 1997 19:39:57 +0000 (19:39 +0000)
committerSamba Release Account <samba-bugs@samba.org>
Thu, 23 Jan 1997 19:39:57 +0000 (19:39 +0000)
file_exists is false.
Jeremy (jra@cygnus.com).

source/smbd/server.c

index 623a3fb2bdfc905324dc287615740e6e4c473e41..2d47816ff7686656d875d622e660db06b414fe11 100644 (file)
@@ -1469,10 +1469,10 @@ void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun,
   DEBUG(4,("calling open_file with flags=0x%X flags2=0x%X mode=0%o\n",
           flags,flags2,mode));
 
-  open_file(fnum,cnum,fname,flags|(flags2&~(O_TRUNC)),mode,&sbuf);
+  open_file(fnum,cnum,fname,flags|(flags2&~(O_TRUNC)),mode,file_existed ? &sbuf : 0);
   if (!Files[fnum].open && flags==O_RDWR && errno!=ENOENT && fcbopen) {
     flags = O_RDONLY;
-    open_file(fnum,cnum,fname,flags,mode,&sbuf);
+    open_file(fnum,cnum,fname,flags,mode,file_existed ? &sbuf : 0 );
   }
 
   if (Files[fnum].open) {