System.Security.SecurityElement patch
Carl-Adam Brengesjö <[email protected]>
| Newsgroups | gmane.comp.gnu.dotgnu.developer |
|---|---|
| Message-ID | <[email protected]> |
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).
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>
But the current implementation cannot acheive this. Should it be like this, or
is it something that should be done?
Carl-Adam Brengesjö
Sweden
SecurityElement.cs.patch
(text/x-diff, 373 B)
--- pnetlib/runtime/System/Security/SecurityElement.cs 2003-08-31 06:32:38.000000000 +0200
+++ pnetlib.mod/runtime/System/Security/SecurityElement.cs 2004-05-03 01:33:36.000000000 +0200
@@ -325,6 +325,7 @@
throw new ArgumentException
(_("Arg_InvalidXMLAttrValue"));
}
+ attributes.Add(new AttrNameValue(name, val));
}
}
}