[Mono-bugs] [Bug 70749][Nor] Changed - CS0647: Error emitting 'PermissionSet' attributes

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 22 Dec 2004 12:20:09 -0500 (EST)


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=70749

--- shadow/70749	2004-12-22 11:55:49.000000000 -0500
+++ shadow/70749.tmp.32149	2004-12-22 12:20:09.000000000 -0500
@@ -11,13 +11,13 @@
 AssignedTo: marek.safar@seznam.cz                            
 ReportedBy: sebastien@ximian.com               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
 Cc: 
-Summary: CS0647: Error emitting 'PermissionSet' attribute for RequestOptional.
+Summary: CS0647: Error emitting 'PermissionSet' attributes
 
 Description of Problem:
 
 MCS doesn't want to encode a PermissionSet attribute for
 SecurityAction.RequestOptional. The error message says it is not a valid
 action for a non-CAS permission, however PermissionSetAttribute inherits
@@ -75,6 +75,54 @@
 Adding patch.
 
 ------- Additional Comments From sebastien@ximian.com  2004-12-22 11:55 -------
 Created an attachment (id=13574)
 attribute.diff
 
+
+------- Additional Comments From sebastien@ximian.com  2004-12-22 12:20 -------
+Example of what I mean by Unrestricted in the last comment.
+
+using System;
+using System.Security;
+using System.Security.Permissions;
+
+[assembly: PermissionSet (SecurityAction.RequestOptional,
+Unrestricted=true)]
+[assembly: SecurityPermission (SecurityAction.RequestOptional,
+Infrastructure=true)]
+
+public class Program {
+
+	static public int Main (string[] args)
+	{
+		return 0;
+	}
+}
+
+Once compiled only the PermissionSet is present in the metadata (as
+the patch does), because the SecurityPermission is irrevelant in an
+Unrestricted permission set.
+
+
+Unless of course the other permissions are non-CAS permission. In this
+case they must still be processed separately. So...
+
+using System;
+using System.Security;
+using System.Security.Permissions;
+
+[assembly: PermissionSet (SecurityAction.RequestOptional,
+Unrestricted=true)]
+[assembly: SecurityPermission (SecurityAction.RequestOptional,
+Infrastructure=true)]
+
+public class Program {
+
+	static public int Main (string[] args)
+	{
+		return 0;
+	}
+}
+
+Would have a both a demand and a noncasdemand entries (also working
+with the patch).