Author: spouliot
Date: 2005-05-25 12:44:13 -0400 (Wed, 25 May 2005)
New Revision: 45006

Modified:
   trunk/mcs/class/corlib/System.Security/ChangeLog
   trunk/mcs/class/corlib/System.Security/SecurityException.cs
Log:
2005-05-25  Sebastien Pouliot  <[EMAIL PROTECTED]>

        * SecurityException.cs: PermissionState isn't always serialized 
        (depending on the security policy) so it cannot always be deserialized
        too (and this must work without throwing exceptions).



Modified: trunk/mcs/class/corlib/System.Security/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.Security/ChangeLog    2005-05-25 16:42:33 UTC 
(rev 45005)
+++ trunk/mcs/class/corlib/System.Security/ChangeLog    2005-05-25 16:44:13 UTC 
(rev 45006)
@@ -1,3 +1,9 @@
+2005-05-25  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * SecurityException.cs: PermissionState isn't always serialized 
+       (depending on the security policy) so it cannot always be deserialized
+       too (and this must work without throwing exceptions).
+
 2005-05-20  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * SecurityContext.cs: Includes more methods in NET_1_1 to enable 

Modified: trunk/mcs/class/corlib/System.Security/SecurityException.cs
===================================================================
--- trunk/mcs/class/corlib/System.Security/SecurityException.cs 2005-05-25 
16:42:33 UTC (rev 45005)
+++ trunk/mcs/class/corlib/System.Security/SecurityException.cs 2005-05-25 
16:44:13 UTC (rev 45006)
@@ -182,7 +182,15 @@
                        : base (info, context)
                {
                        base.HResult = unchecked ((int)0x8013150A);
-                       permissionState = info.GetString ("PermissionState");
+                       // depending on the security policy the info about 
PermissionState may
+                       // not be available (but the serializable must work)
+                       SerializationInfoEnumerator e = info.GetEnumerator ();
+                       while (e.MoveNext ()) {
+                               if (e.Name == "PermissionState") {
+                                       permissionState = (string) e.Value;
+                                       break;
+                               }
+                       }
                }
                
                public SecurityException (string message, Exception inner) 

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

Reply via email to