2010-03-11 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Thu, 11 Mar 2010 00:49:37 +0000 (00:49 -0000)
committerZoltan Varga <vargaz@gmail.com>
Thu, 11 Mar 2010 00:49:37 +0000 (00:49 -0000)
* Path.cs (GetTempFileName): Fix infinite loop if the process doesn't have
write access to /tmp. Fixes #585017.

svn path=/trunk/mcs/; revision=153433

mcs/class/corlib/System.IO/ChangeLog
mcs/class/corlib/System.IO/Path.cs

index 3168f53734076932e67b631eb234e19168ce643f..8f2b4c78e7af847d3036c0e04d2919048a39e67f 100644 (file)
@@ -1,3 +1,8 @@
+2010-03-11  Zoltan Varga  <vargaz@gmail.com>
+
+       * Path.cs (GetTempFileName): Fix infinite loop if the process doesn't have
+       write access to /tmp. Fixes #585017.
+
 2010-02-22  Carlos Alberto Cortez <calberto.cortez@gmail.com>
 
        * MemoryStream.cs: When setting Capacity, don't create a new buffer if
index e16343b37d177ec425855bb508882ec47472f1fd..0c78b0350aae11adb712d5d98c9d4eab38cf6dda 100644 (file)
@@ -451,6 +451,10 @@ namespace System.IO {
                                        // avoid an endless loop
                                        throw;
                                }
+                               catch (UnauthorizedAccessException) {
+                                       // This can happen if we don't have write permission to /tmp
+                                       throw;
+                               }
                                catch {
                                }
                        } while (f == null);