Author: spouliot
Date: 2005-03-24 09:30:33 -0500 (Thu, 24 Mar 2005)
New Revision: 42216

Modified:
   trunk/mcs/class/corlib/System.Security.Permissions/ChangeLog
   trunk/mcs/class/corlib/System.Security.Permissions/FileIOPermission.cs
   
trunk/mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermission.cs
Log:
2005-03-24  Sebastien Pouliot  <[EMAIL PROTECTED]>

        * 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.



Modified: trunk/mcs/class/corlib/System.Security.Permissions/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.Security.Permissions/ChangeLog        
2005-03-24 14:24:38 UTC (rev 42215)
+++ trunk/mcs/class/corlib/System.Security.Permissions/ChangeLog        
2005-03-24 14:30:33 UTC (rev 42216)
@@ -1,3 +1,11 @@
+2005-03-24  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * 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  <[EMAIL PROTECTED]>
 
        * IsolatedStorageContainment.cs: Add missing BOOTSTRAP_NET_2_0 to new

Modified: trunk/mcs/class/corlib/System.Security.Permissions/FileIOPermission.cs
===================================================================
--- trunk/mcs/class/corlib/System.Security.Permissions/FileIOPermission.cs      
2005-03-24 14:24:38 UTC (rev 42215)
+++ trunk/mcs/class/corlib/System.Security.Permissions/FileIOPermission.cs      
2005-03-24 14:30:33 UTC (rev 42216)
@@ -147,7 +147,8 @@
                // 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 @@
                        }
                        // 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 @@
                                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 @@
 
                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;

Modified: 
trunk/mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermission.cs
===================================================================
--- 
trunk/mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermission.cs 
    2005-03-24 14:24:38 UTC (rev 42215)
+++ 
trunk/mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermission.cs 
    2005-03-24 14:30:33 UTC (rev 42216)
@@ -6,7 +6,7 @@
 //     Sebastien Pouliot  <[EMAIL PROTECTED]>
 //
 // (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 @@
 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 @@
                }
        }
 }
-
-
-
-
-

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to