diff options
3 files changed, 17 insertions, 15 deletions
diff --git a/mcs/class/corlib/System.Security.Permissions/ChangeLog b/mcs/class/corlib/System.Security.Permissions/ChangeLog index 1c933765ad5..7b53a75e8fa 100644 --- a/mcs/class/corlib/System.Security.Permissions/ChangeLog +++ b/mcs/class/corlib/System.Security.Permissions/ChangeLog @@ -1,3 +1,11 @@ +2005-03-24 Sebastien Pouliot <sebastien@ximian.com> + + * FileIOPermission.cs: Now use InsecureGetFullPath to add paths to + it's lists (as GetFullPath is more restricted than the permission). + Removed unrequired use of GetFullPath in union and subset ops. + * IsolatedStoragePermission.cs: Added InheritanceDemand for + ControlEvidence and ControlPolicy on class. + 2005-03-17 Sebastien Pouliot <sebastien@ximian.com> * IsolatedStorageContainment.cs: Add missing BOOTSTRAP_NET_2_0 to new diff --git a/mcs/class/corlib/System.Security.Permissions/FileIOPermission.cs b/mcs/class/corlib/System.Security.Permissions/FileIOPermission.cs index c1f6447e917..32581496223 100644 --- a/mcs/class/corlib/System.Security.Permissions/FileIOPermission.cs +++ b/mcs/class/corlib/System.Security.Permissions/FileIOPermission.cs @@ -147,7 +147,8 @@ namespace System.Security.Permissions { // internal to avoid duplicate checks internal void AddPathInternal (FileIOPermissionAccess access, string path) { - path = Path.GetFullPath (path); + // call InsecureGetFullPath (and not GetFullPath) to avoid recursion + path = Path.InsecureGetFullPath (path); if ((access & FileIOPermissionAccess.Read) == FileIOPermissionAccess.Read) readList.Add (path); @@ -440,7 +441,7 @@ namespace System.Security.Permissions { }
// LAMESPEC: docs don't say it must be a rooted path, but the MS implementation enforces it, so we will too.
if (!Path.IsPathRooted (path)) { - string msg = Locale.GetText ("Absolute path information is required.");
+ string msg = Locale.GetText ("Absolute path information is required."); throw new ArgumentException (msg, "path");
} } @@ -464,13 +465,13 @@ namespace System.Security.Permissions { pathList.Clear (); }
+ // note: all path in IList are already "full paths" internal bool KeyIsSubsetOf (IList local, IList target) { bool result = false; foreach (string l in local) { - string c14nl = Path.GetFullPath (l); foreach (string t in target) { - if (c14nl.StartsWith (Path.GetFullPath (t))) { + if (l.StartsWith (t)) { result = true; break; } @@ -483,17 +484,14 @@ namespace System.Security.Permissions { internal void UnionKeys (IList list, string[] paths) { - foreach (string p in paths) { - // c14n - string path = Path.GetFullPath (p); + foreach (string path in paths) { int len = list.Count; if (len == 0) { list.Add (path); } else { for (int i=0; i < len; i++) { - // c14n - string s = Path.GetFullPath ((string) list [i]); + string s = (string) list [i]; if (s.StartsWith (path)) { // replace (with reduced version) list [i] = path; diff --git a/mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermission.cs b/mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermission.cs index 351dd12e06e..d07cac0d12e 100644 --- a/mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermission.cs +++ b/mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermission.cs @@ -6,7 +6,7 @@ // Sebastien Pouliot <sebastien@ximian.com> // // (C) 2002 Ximian, Inc. http://www.ximian.com -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) +// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -33,6 +33,7 @@ using System.Globalization; namespace System.Security.Permissions { [Serializable] + [SecurityPermission (SecurityAction.InheritanceDemand, ControlEvidence = true, ControlPolicy = true)] public abstract class IsolatedStoragePermission : CodeAccessPermission, IUnrestrictedPermission { private const int version = 1; @@ -124,8 +125,3 @@ namespace System.Security.Permissions { } } } - - - - - |