Re: System.Security.SecurityElement patch

Rhys Weatherley <[email protected]>
Newsgroups gmane.comp.gnu.dotgnu.developer
Organization Southern Storm Software, Pty Ltd
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.