* Directory.cs, DirectoryInfo.cs: Disble new NET_4_0 API used in
SL4 until we have elevated trust working correctly (since they
are *not* decorated as [SecurityCritical])
svn path=/trunk/mcs/; revision=153968
+2010-03-22 Sebastien Pouliot <sebastien@ximian.com>
+
+ * Directory.cs, DirectoryInfo.cs: Disble new NET_4_0 API used in
+ SL4 until we have elevated trust working correctly (since they
+ are *not* decorated as [SecurityCritical])
+
2010-03-17 Gonzalo Paniagua Javier <gonzalo@novell.com>
* StreamReader.cs: if the detected encoding is different from the
return result;
}
+ internal static void ValidatePath (string path)
+ {
+#if MOONLIGHT
+ // On Moonlight (SL4+) this is possible, with limitations, in "Elevated Trust"
+ throw new SecurityException ("we're not ready to enable this SL4 feature yet");
+#endif
+ }
+
#if NET_4_0 || MOONLIGHT
public static string[] GetFileSystemEntries (string path, string searchPattern, SearchOption searchOption)
{
if (searchOption != SearchOption.TopDirectoryOnly && searchOption != SearchOption.AllDirectories)
throw new ArgumentOutOfRangeException ("searchoption");
+ ValidatePath (path);
+
bool stop;
string path_with_pattern = ValidateDirectoryListing (path, searchPattern, out stop);
if (stop){
MonoIOError error;
FileAttributes rattr;
bool subdirs = searchOption == SearchOption.AllDirectories;
+
+ Directory.ValidatePath (full); // required for Moonlight, nop-op otherwise
string s = MonoIO.FindFirst (full, path_with_pattern, out rattr, out error, out handle);
if (s == null)