[Mono-bugs] [Bug 62358][Nor] Changed - MCS doesn't encode SecurityAttributes properly

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 6 Oct 2004 10:41:42 -0400 (EDT)


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 sebastien@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=62358

--- shadow/62358	2004-10-05 11:31:48.000000000 -0400
+++ shadow/62358.tmp.10164	2004-10-06 10:41:42.000000000 -0400
@@ -276,6 +276,28 @@
 
 [1] casnoncas.cs
 http://bugzilla.ximian.com/showattachment.cgi?attach_id=12062
 
 [2] noncasonly.cs
 http://bugzilla.ximian.com/showattachment.cgi?attach_id=12063
+
+------- Additional Comments From sebastien@ximian.com  2004-10-06 10:41 -------
+Another case to check (related to the previous one)
+
+Non-CAS permissions cannot be used for SecurityAction.Assert, Deny or
+PermitOnly (see new attachement cs0647-assert.cs).
+
+$ csc cs0647-assert.cs
+Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
+for Microsoft (R) .NET Framework version 1.1.4322
+Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.
+
+cs0647-assert.cs(7,2): error CS0647: Error emitting
+        'System.Security.Permissions.PrincipalPermissionAttribute'
+attribute --
+        'Invalid SecurityAction for non-Code Access Security permission.'
+
+
+Note: This check is done only in 1.0/1.1 (CSC 7.0/7.1). C# 2.0 (CSC
+8.0) does compile the assembly (and the assert is encoded into the
+assembly metadata, but probably ignored later).
+