[Mono-bugs] [Bug 76125][Min] New - TempFileCollection can create a temp file that already exists

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Sep 16 14:20:46 EDT 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by james.mcbride at gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=76125

--- shadow/76125	2005-09-16 14:20:46.000000000 -0400
+++ shadow/76125.tmp.26234	2005-09-16 14:20:46.000000000 -0400
@@ -0,0 +1,45 @@
+Bug#: 76125
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: gentoo 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: james.mcbride at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: TempFileCollection can create a temp file that already exists
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+When you're creating a temp file using CompilerParameters.TempFiles the
+TempFileCollection doesn't check to see if that file name is taken. It just
+picks a random number
+
+(from TempFileCollection.cs)
+
+string random = rnd.Next (10000,99999).ToString ();
+basepath = Path.Combine (tempdir, random);
+
+
+Actual Results:
+duplicate file name can be given. This has happend in code that rapidly
+sends out serialized objects since the serializer  GenerateSerializers in
+XmlSerializer.cs generated temp files this way.
+
+Expected Results:
+given temp name should always be available. Unless name was taken in
+between name generation and file creation.
+
+How often does this happen? 
+very rarely.
+
+Additional Information:


More information about the mono-bugs mailing list