X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2Fcorlib%2FSystem.IO%2FFileSystemInfo.cs;h=9c2c3fae9f05eb3f21e12028c6c38e6d343370f9;hb=b52c963187c59fd167cfde556dfd4304f8ded041;hp=574ab1d573c8e14730737a5fd83611c645eadbb5;hpb=0204abe80374a7f021d91a7c226ef07587195c8a;p=mono.git diff --git a/mcs/class/corlib/System.IO/FileSystemInfo.cs b/mcs/class/corlib/System.IO/FileSystemInfo.cs index 574ab1d573c..9c2c3fae9f0 100644 --- a/mcs/class/corlib/System.IO/FileSystemInfo.cs +++ b/mcs/class/corlib/System.IO/FileSystemInfo.cs @@ -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;