Pass cancellation token to CopyAsync read block
[mono.git] / mcs / class / corlib / System.IO / FileSystemInfo.cs
index 574ab1d573c8e14730737a5fd83611c645eadbb5..9c2c3fae9f05eb3f21e12028c6c38e6d343370f9 100644 (file)
@@ -3,6 +3,7 @@
 // System.IO.FileSystemInfo.cs 
 //
 // Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
+// Copyright 2011 Xamarin Inc (http://www.xamarin.com).
 // 
 // Author:         Jim Richardson, develop@wtfo-guru.com
 //                 Dan Lewis (dihlewis@yahoo.co.uk)
@@ -35,6 +36,7 @@
 
 using System.Runtime.InteropServices;
 using System.Runtime.Serialization;
+using System.Security;
 using System.Security.Permissions;
 
 namespace System.IO {
@@ -101,6 +103,8 @@ namespace System.IO {
                        }
 
                        set {
+                               SecurityManager.EnsureElevatedPermissions (); // this is a no-op outside moonlight
+
                                long filetime = value.ToFileTime ();
                        
                                MonoIOError error;
@@ -131,6 +135,8 @@ namespace System.IO {
                        }
 
                        set {
+                               SecurityManager.EnsureElevatedPermissions (); // this is a no-op outside moonlight
+
                                long filetime = value.ToFileTime ();
 
                                MonoIOError error;
@@ -163,6 +169,8 @@ namespace System.IO {
                        }
 
                        set {
+                               SecurityManager.EnsureElevatedPermissions (); // this is a no-op outside moonlight
+
                                long filetime = value.ToFileTime ();
 
                                MonoIOError error;
@@ -249,6 +257,11 @@ namespace System.IO {
                                throw new ArgumentException ("An empty file name is not valid.");
                        if (path.IndexOfAny (Path.InvalidPathChars) != -1)
                                throw new ArgumentException ("Illegal characters in path.");
+                       if (Environment.IsRunningOnWindows) {
+                               int idx = path.IndexOf (':');
+                               if (idx >= 0 && idx != 1)
+                                       throw new ArgumentException ("path");
+                       }
                }
 
                internal MonoIOStat stat;