[Mono-bugs] [Bug 82314][Min] New - IsolatedStorageFileStreams over rooted paths throw UnauthorizedAccessException

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Aug 3 17:09:30 EDT 2007


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 jnmiller at cryptofreak.org.

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

--- shadow/82314	2007-08-03 17:09:30.000000000 -0400
+++ shadow/82314.tmp.3521	2007-08-03 17:09:30.000000000 -0400
@@ -0,0 +1,71 @@
+Bug#: 82314
+Product: Mono: Class Libraries
+Version: 1.2
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 001 One hour
+Priority: Minor
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: jnmiller at cryptofreak.org               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: IsolatedStorageFileStreams over rooted paths throw UnauthorizedAccessException
+
+Description of Problem:
+
+With the latest out of SVN, IsolatedStorageFileStreams over rooted paths
+throw UnauthorizedAccessException.  This does not happen when using the MS
+library.
+
+The problem is that Mono's ISFS path creator uses Path.Combine() without
+regard to the requested path's content.  Path.Combine() in turn returns
+only the second argument when that argument is a rooted path.  ISFS
+therefore attempts to create its IS file off of the root directory which
+is, of course, unauthorized.
+
+
+Steps to reproduce the problem:
+1. ISFS fs = new ISFS("/rootpath", FileMode.Create);
+
+
+Actual Results:
+
+Unhandled Exception: System.UnauthorizedAccessException: Access to the path
+"rootpath" is denied.
+  at System.IO.FileStream..ctor (System.String name, FileMode mode,
+FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous,
+FileOptions options) [0x00000] 
+  at System.IO.FileStream..ctor (System.String name, FileMode mode,
+FileAccess access, FileShare share, Int32 bufferSize, Boolean isAsync,
+Boolean anonymous) [0x00000] 
+  at System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor
+(System.String path, FileMode mode, FileAccess access, FileShare share,
+Int32 bufferSize, System.IO.IsolatedStorage.IsolatedStorageFile isf) [0x00000] 
+  at System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor
+(System.String path, FileMode mode) [0x00000] 
+  at (wrapper remoting-invoke-with-check)
+System.IO.IsolatedStorage.IsolatedStorageFileStream:.ctor
+(string,System.IO.FileMode)
+  at Test.Test.Main (System.String[] args) [0x00000] 
+
+
+Expected Results:
+
+Success.
+
+
+How often does this happen? 
+
+Always!
+
+
+Additional Information:
+
+I have included a patch for ISFS.cs and a unit test to cover this minor
+issue.  I also included a simple test program that looks the same as the
+unit test.


More information about the mono-bugs mailing list