Author: spouliot
Date: 2005-03-15 08:03:49 -0500 (Tue, 15 Mar 2005)
New Revision: 41834

Modified:
   trunk/mcs/class/corlib/System.Security/ChangeLog
   trunk/mcs/class/corlib/System.Security/CodeAccessPermission.cs
   trunk/mcs/class/corlib/System.Security/PermissionSet.cs
   trunk/mcs/class/corlib/System.Security/SecurityFrame.cs
Log:
2005-03-15  Sebastien Pouliot  <[EMAIL PROTECTED]>

        * CodeAccessPermission.cs: Fixed depth for starting the stack walk
        (imperative) and fixed assert condition.
        * PermissionSet.cs: Fixed depth for starting the stack walk.
        * SecurityFrame.cs: Reversed stack. Added optional debugging code.



Modified: trunk/mcs/class/corlib/System.Security/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.Security/ChangeLog    2005-03-15 12:31:53 UTC 
(rev 41833)
+++ trunk/mcs/class/corlib/System.Security/ChangeLog    2005-03-15 13:03:49 UTC 
(rev 41834)
@@ -1,3 +1,10 @@
+2005-03-15  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * CodeAccessPermission.cs: Fixed depth for starting the stack walk
+       (imperative) and fixed assert condition.
+       * PermissionSet.cs: Fixed depth for starting the stack walk.
+       * SecurityFrame.cs: Reversed stack. Added optional debugging code.
+
 2005-03-14  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * SecurityManager.cs: Fix CodeAccessPermissionTest.CustomCAS unit test

Modified: trunk/mcs/class/corlib/System.Security/CodeAccessPermission.cs
===================================================================
--- trunk/mcs/class/corlib/System.Security/CodeAccessPermission.cs      
2005-03-15 12:31:53 UTC (rev 41833)
+++ trunk/mcs/class/corlib/System.Security/CodeAccessPermission.cs      
2005-03-15 13:03:49 UTC (rev 41834)
@@ -100,7 +100,7 @@
                                return;
 
                        // skip frames until we get the caller (of our caller)
-                       new PermissionSet (this).CasOnlyDemand (2);
+                       new PermissionSet (this).CasOnlyDemand (3);
                }
 
                [MonoTODO ("Imperative mode isn't supported")]
@@ -355,7 +355,7 @@
                        // 4. CheckAssert
                        if (frame.Assert != null) {
                                foreach (IPermission p in frame.Assert) {
-                                       if (!CheckAssert (p as 
CodeAccessPermission)) {
+                                       if (CheckAssert (p as 
CodeAccessPermission)) {
                                                // FIXME: partial asserts
                                                return true; // stop the stack 
walk
                                        }

Modified: trunk/mcs/class/corlib/System.Security/PermissionSet.cs
===================================================================
--- trunk/mcs/class/corlib/System.Security/PermissionSet.cs     2005-03-15 
12:31:53 UTC (rev 41833)
+++ trunk/mcs/class/corlib/System.Security/PermissionSet.cs     2005-03-15 
13:03:49 UTC (rev 41834)
@@ -216,7 +216,7 @@
                        // - the permission set only contains non CAS 
permissions; or
                        // - security isn't enabled (applis only to CAS!)
                        if (!cas.IsEmpty () && SecurityManager.SecurityEnabled)
-                               CasOnlyDemand (_declsec ? 4 : 2);
+                               CasOnlyDemand (_declsec ? 5 : 3);
                }
 
                // The number of frames to skip depends on who's calling

Modified: trunk/mcs/class/corlib/System.Security/SecurityFrame.cs
===================================================================
--- trunk/mcs/class/corlib/System.Security/SecurityFrame.cs     2005-03-15 
12:31:53 UTC (rev 41833)
+++ trunk/mcs/class/corlib/System.Security/SecurityFrame.cs     2005-03-15 
13:03:49 UTC (rev 41834)
@@ -148,6 +148,15 @@
                        foreach (RuntimeSecurityFrame frame in stack) {
                                al.Add (new SecurityFrame (frame));
                        }
+                       al.Reverse ();
+#if false
+                       Console.WriteLine ("Stack Dump (skip {0})", skipFrames);
+                       int i=1;
+                       foreach (SecurityFrame f in al) {
+                               Console.WriteLine ("\t{0}. {1}", i++, f.Method);
+                       }
+                       Console.WriteLine ("End Stack Dump");
+#endif
                        return al;
                }
        }

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

Reply via email to