Author: spouliot
Date: 2005-03-23 08:14:41 -0500 (Wed, 23 Mar 2005)
New Revision: 42141
Modified:
trunk/mono/mono/metadata/ChangeLog
trunk/mono/mono/metadata/security-manager.c
Log:
2005-03-23 Sebastien Pouliot <[EMAIL PROTECTED]>
* security-manager.c: Skip inheritance checks for intra-corlib
class inheritance and method overrides. This skips a lot of checks
and (anyway) permissions cannot work until corlib is loaded.
Modified: trunk/mono/mono/metadata/ChangeLog
===================================================================
--- trunk/mono/mono/metadata/ChangeLog 2005-03-23 13:05:05 UTC (rev 42140)
+++ trunk/mono/mono/metadata/ChangeLog 2005-03-23 13:14:41 UTC (rev 42141)
@@ -1,3 +1,9 @@
+2005-03-23 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * security-manager.c: Skip inheritance checks for intra-corlib
+ class inheritance and method overrides. This skips a lot of checks
+ and (anyway) permissions cannot work until corlib is loaded.
+
2005-03-23 Martin Baulig <[EMAIL PROTECTED]>
* marshal.c (mono_marshal_get_stfld_wrapper): Add support for
Modified: trunk/mono/mono/metadata/security-manager.c
===================================================================
--- trunk/mono/mono/metadata/security-manager.c 2005-03-23 13:05:05 UTC (rev
42140)
+++ trunk/mono/mono/metadata/security-manager.c 2005-03-23 13:14:41 UTC (rev
42141)
@@ -107,6 +107,11 @@
if (klass->exception_type != 0)
return;
+ /* short-circuit corlib as it is fully trusted (within itself)
+ * and because this cause major recursion headaches */
+ if ((klass->image == mono_defaults.corlib) && (parent->image ==
mono_defaults.corlib))
+ return;
+
/* Check if there are an InheritanceDemand on the parent class */
if (mono_declsec_get_inheritdemands_class (parent, &demands)) {
/* If so check the demands on the klass (inheritor) */
@@ -127,6 +132,11 @@
if (override->klass->exception_type != 0)
return;
+ /* short-circuit corlib as it is fully trusted (within itself)
+ * and because this cause major recursion headaches */
+ if ((override->klass->image == mono_defaults.corlib) &&
(base->klass->image == mono_defaults.corlib))
+ return;
+
/* Check if there are an InheritanceDemand on the base (virtual) method
*/
if (mono_declsec_get_inheritdemands_method (base, &demands)) {
/* If so check the demands on the overriding method */
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches