dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]System.Security.SecurityElement patch


From: Rhys Weatherley
Subject: Re: [DotGNU]System.Security.SecurityElement patch
Date: Mon, 3 May 2004 11:43:37 +1000
User-agent: KMail/1.4.3

On Monday 03 May 2004 10:04 am,        * include/jit/jit-type.h, 
jit/jit-type.c: tag the system-dependent
        types so that they can be distinguished from the fixed-sized types
        when it is necessary to do so.
 wrote:
> Noticed that the set method of the `Attributes' property didn't actually
> save the values, it just walked the hashtable, checked it's values for
> invalid data and then just returned. (see attached patch).

I've applied the patch - good catch.

> And I also though of something else, as the hashtable are being constructed
> each time it's being fetched (get_Attributes) you cant add attributes
> afterwards, like:
>
>   SecurityElement se = new SecurityElement("user", "foo");
>   se.Attributes.Add("group", "bar"); // won't have any effect
>
> the plain XML should look like this:
>   <user group="bar">foo</user>
> but looks like this:
>   <user>foo</user>

This is deliberate.  The "Attributes" element on a security element always 
makes a copy of the entire list before returning it in the hash table.  This 
is consistent with MS'es implementation.  You must use "AddAttribute" to add 
an attribute to a security element.  The "bug" is MS'es - we just copied it 
for compatibility purposes.

Cheers,

Rhys.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]