projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
2009-04-28 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git]
/
mono
/
metadata
/
security-manager.c
diff --git
a/mono/metadata/security-manager.c
b/mono/metadata/security-manager.c
index fb263c45ac6b992113fb3a8e4d8252c4f51b9436..eee0a29458f4c4c85e3c5670f24e967c3082d6c0 100644
(file)
--- a/
mono/metadata/security-manager.c
+++ b/
mono/metadata/security-manager.c
@@
-4,7
+4,7
@@
* Author:
* Sebastien Pouliot <sebastien@ximian.com>
*
* Author:
* Sebastien Pouliot <sebastien@ximian.com>
*
- * Copyright
(C) 2004-2005
Novell, Inc (http://www.novell.com)
+ * Copyright
2005-2009
Novell, Inc (http://www.novell.com)
*/
#include "security-manager.h"
*/
#include "security-manager.h"
@@
-16,10
+16,23
@@
static MonoSecurityManager secman;
static MonoBoolean mono_security_manager_activated = FALSE;
static MonoBoolean mono_security_manager_enabled = TRUE;
static MonoBoolean mono_security_manager_execution = TRUE;
static MonoBoolean mono_security_manager_activated = FALSE;
static MonoBoolean mono_security_manager_enabled = TRUE;
static MonoBoolean mono_security_manager_execution = TRUE;
+static MonoSecurityMode mono_security_mode = MONO_SECURITY_MODE_NONE;
/* Public stuff */
/* Public stuff */
+void
+mono_security_set_mode (MonoSecurityMode mode)
+{
+ mono_security_mode = mode;
+}
+
+MonoSecurityMode
+mono_security_get_mode (void)
+{
+ return mono_security_mode;
+}
+
MonoSecurityManager*
mono_security_manager_get_methods (void)
{
MonoSecurityManager*
mono_security_manager_get_methods (void)
{
@@
-67,7
+80,7
@@
mono_security_manager_get_methods (void)
g_assert (secman.linkdemandfulltrust);
secman.linkdemandsecurityexception = mono_class_get_method_from_name (secman.securitymanager,
g_assert (secman.linkdemandfulltrust);
secman.linkdemandsecurityexception = mono_class_get_method_from_name (secman.securitymanager,
- "LinkDemandSecurityException",
3
);
+ "LinkDemandSecurityException",
2
);
g_assert (secman.linkdemandsecurityexception);
secman.allowpartiallytrustedcallers = mono_class_from_name (mono_defaults.corlib, "System.Security",
g_assert (secman.linkdemandsecurityexception);
secman.allowpartiallytrustedcallers = mono_class_from_name (mono_defaults.corlib, "System.Security",
@@
-118,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) */
/* 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);
}
}
}
}
}
}
@@
-143,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) */
/* 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);
}
}
}
}
}
}