[Mono-bugs] [Bug 81133][Maj] New - mono --security throws System.NullReferenceException

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Mar 13 21:32:28 EDT 2007

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by michael at ynet.sk.


--- shadow/81133	2007-03-13 20:32:28.000000000 -0500
+++ shadow/81133.tmp.7385	2007-03-13 20:32:28.000000000 -0500
@@ -0,0 +1,72 @@
+Bug#: 81133
+Product: Mono: Class Libraries
+Version: 1.2
+OS Details: Debian Etch, kernel, x86_64
+Status: NEW   
+Priority: Major
+Component: System.Security
+AssignedTo: sebastien at ximian.com                            
+ReportedBy: michael at ynet.sk               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: mono --security throws System.NullReferenceException
+Description of Problem:
+Invocation mono with --security parameter throws always NullReferenceException
+Steps to reproduce the problem:
+1. for example try to compile this:
+2. mono --security CompiledProgram
+Actual Results:
+[this should print - as JIT will accept the unauthenticated LinkDemand]
+*2* Unexpected Exception
+System.NullReferenceException: Object reference not set to an instance of
+an object
+  at System.Security.Policy.PolicyLevel.Resolve
+(System.Security.Policy.Evidence evidence) [0x00000]
+  at System.Security.SecurityManager.ResolvePolicyLevel
+(System.Security.PermissionSet& ps, System.Security.Policy.PolicyLevel pl,
+System.Security.Policy.Evidence evidence) [0x00000]
+  at System.Security.SecurityManager.ResolvePolicy
+(System.Security.Policy.Evidence evidence) [0x00000]
+  at System.Security.SecurityManager.ResolvePolicy
+(System.Security.Policy.Evidence evidence, System.Security.PermissionSet
+reqdPset, System.Security.PermissionSet optPset,
+System.Security.PermissionSet denyPset, System.Security.PermissionSet&
+denied) [0x00000]
+  at System.Reflection.Assembly.Resolve () [0x00000]
+  at System.Reflection.Assembly.get_GrantedPermissionSet () [0x00000]
+  at System.Security.SecurityManager.IsGranted (System.Reflection.Assembly
+a, IPermission perm) [0x00000]
+  at System.Security.SecurityManager.CheckPermissionSet
+(System.Reflection.Assembly a, System.Security.PermissionSet ps, Boolean
+noncas) [0x00000]
+  at System.Security.PermissionSet.CheckAssembly
+(System.Reflection.Assembly a, SecurityFrame frame) [0x00000]
+  at System.Security.PermissionSet.CasOnlyDemand (Int32 skip) [0x00000]
+  at System.Security.PermissionSet.Demand () [0x00000]
+  at System.Security.SecurityManager.InternalDemand (IntPtr permissions,
+Int32 length) [0x00000]
+  at System.Threading.Thread.set_CurrentPrincipal (IPrincipal value) [0x00000]
+  at LinkDemandTest.Test () [0x00000]
+  at LinkDemandTest.Main (System.String[] args) [0x00000]
+Expected Results:
+[this should print - as JIT will accept the unauthenticated LinkDemand]
+*0* [this should print]
+How often does this happen? 
+Additional Information:
+In fact I need security manager for real project not for this test. I am
+using in .NET PrincipalPermission attribute in this usage:
+[PrincipalPermission(SecurityAction.Demand, Role = "test")] as critical
+part of remote proxy security.

More information about the mono-bugs mailing list