[Mono-bugs] [Bug 683269] New: Unable to instantiate KeyContainerPermission class.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Mar 28 21:02:10 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=683269

https://bugzilla.novell.com/show_bug.cgi?id=683269#c0


           Summary: Unable to instantiate KeyContainerPermission class.
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.10.x
          Platform: x86
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System.Security
        AssignedTo: spouliot at novell.com
        ReportedBy: sakno at tncor.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1;
Trident/5.0)

Unable to create a new instance of KeyContainerPermission class with
constructor that accepts KeyContainerPermissionFlags (except
KeyContainerPermissionFlags.NoFlags value).



Reproducible: Always

Steps to Reproduce:
var keycont = new KeyContainerPermission(KeyContainerPermissionFlags.Open);
keycont.Demand();
Actual Results:  
Unhandled Exception: System.ArgumentException: Invalid enum Open
Parameter name: KeyContainerPermissionFlags
  at System.Security.Permissions.KeyContainerPermission.SetFlags
(KeyContainerPermissionFlags flags) [0x00000] in <filename unknown>:0 
  at System.Security.Permissions.KeyContainerPermission..ctor
(KeyContainerPermissionFlags flags) [0x00000] in <filename unknown>:0

Expected Results:  
A new instance of security permission.

Implementation of SetFlags private method inside of KeyContainerPermission
class says that any flags except KeyContainerPermissionFlags.Open are invalid.
private void SetFlags(KeyContainerPermissionFlags flags)
{
    if ((flags & KeyContainerPermissionFlags.AllFlags) !=
KeyContainerPermissionFlags.NoFlags)
    {
        throw new ArgumentException(string.Format(Locale.GetText("Invalid enum
{0}"), flags), "KeyContainerPermissionFlags");
    }
    this._flags = flags;
}
Mono Class status page and API reference do not say anything about this.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list