X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Fsecurity-manager.c;h=cab10abf6f11d9834e9c628c375e6f08eb8aa00d;hb=4bea9c5b12f08362ff2bfdc92aedaa6898f5d6c5;hp=167546f71f319f554e1b007a85c1db01c3b60f37;hpb=25686043e1a810a989c3a089ecc81cba20d9406f;p=mono.git diff --git a/mono/metadata/security-manager.c b/mono/metadata/security-manager.c index 167546f71f3..cab10abf6f1 100644 --- a/mono/metadata/security-manager.c +++ b/mono/metadata/security-manager.c @@ -4,7 +4,7 @@ * Author: * Sebastien Pouliot * - * Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com) + * Copyright 2005-2009 Novell, Inc (http://www.novell.com) */ #include "security-manager.h" @@ -131,8 +131,7 @@ mono_secman_inheritancedemand_class (MonoClass *klass, MonoClass *parent) /* If so check the demands on the klass (inheritor) */ if (!mono_secman_inheritance_check (klass, &demands)) { /* Keep flags in MonoClass to be able to throw a SecurityException later (if required) */ - klass->exception_type = MONO_EXCEPTION_SECURITY_INHERITANCEDEMAND; - klass->exception_data = NULL; + mono_class_set_failure (klass, MONO_EXCEPTION_SECURITY_INHERITANCEDEMAND, NULL); } } } @@ -156,8 +155,7 @@ mono_secman_inheritancedemand_method (MonoMethod *override, MonoMethod *base) /* If so check the demands on the overriding method */ if (!mono_secman_inheritance_check (override->klass, &demands)) { /* Keep flags in MonoClass to be able to throw a SecurityException later (if required) */ - override->klass->exception_type = MONO_EXCEPTION_SECURITY_INHERITANCEDEMAND; - override->klass->exception_data = base; + mono_class_set_failure (override->klass, MONO_EXCEPTION_SECURITY_INHERITANCEDEMAND, base); } } } @@ -236,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; }