2009-10-23 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Fri, 23 Oct 2009 14:32:13 +0000 (14:32 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Fri, 23 Oct 2009 14:32:13 +0000 (14:32 -0000)
* security-manager.c: Report if core-clr is active from
ves_icall_System_Security_SecurityManager_get_SecurityEnabled
to allow Moonlight BCL to behave appropriately (both in browser
and outside, e.g. smcs)

svn path=/trunk/mono/; revision=144737

mono/metadata/ChangeLog
mono/metadata/security-manager.c

index 89df6b7a54f61c3b3f417e09260064d1d9dd265b..21c80e3bf931307d99f3c12fd4def8b5cc90b643 100644 (file)
@@ -1,3 +1,10 @@
+2009-10-23  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * security-manager.c: Report if core-clr is active from
+       ves_icall_System_Security_SecurityManager_get_SecurityEnabled
+       to allow Moonlight BCL to behave appropriately (both in browser
+       and outside, e.g. smcs)
+
 2009-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
 
        * mono-config.c: ignore UTF-8 BOM and report parser errors.
index eee0a29458f4c4c85e3c5670f24e967c3082d6c0..cab10abf6f11d9834e9c628c375e6f08eb8aa00d 100644 (file)
@@ -234,8 +234,12 @@ mono_get_context_capture_method (void)
 MonoBoolean
 ves_icall_System_Security_SecurityManager_get_SecurityEnabled (void)
 {
-       if (!mono_security_manager_activated)
-               return FALSE;
+       if (!mono_security_manager_activated) {
+               /* SecurityManager is internal for Moonlight and SecurityEnabled is used to know if CoreCLR is active
+                * (e.g. plugin executing in the browser) or not (e.g. smcs compiling source code with corlib 2.1)
+                */
+               return (mono_security_get_mode () == MONO_SECURITY_MODE_CORE_CLR);
+       }
        return mono_security_manager_enabled;
 }