[Mono-list] SecurityIdentifier and IdentityReference op_Equality

Sebastien Pouliot sebastien.pouliot at gmail.com
Wed Aug 8 11:22:39 EDT 2007


Hello Bruce,

On Wed, 2007-08-08 at 07:57 -0700, Bruce Wilkie wrote:
> while doing some offline code analysis, these two classes in the System.Security.Principal namespace appear to have infinite recursion in their op_Equality methods:

This is already fixed in SVN.

> C#:
> ----
>   public static bool operator == (SecurityIdentifier left, SecurityIdentifier right)
>   {
>    if (left == null)
>     return (right == null);
>    if (right == null)
>     return false;
>    return (left.Value == right.Value);
>   }
> ----
> IL:
> ----
>   IL_0000:  ldarg.0
>   IL_0001:  ldnull
>   IL_0002:  call       bool System.Security.Principal.SecurityIdentifier::op_Equality(class System.Security.Principal.SecurityIdentifier,
>                                                                                       class System.Security.Principal.SecurityIdentifier)
>   IL_0007:  brfalse.s  IL_0011
>   IL_0009:  ldarg.1
>   IL_000a:  ldnull
>   IL_000b:  call       bool System.Security.Principal.SecurityIdentifier::op_Equality(class System.Security.Principal.SecurityIdentifier,
>                                                                                       class System.Security.Principal.SecurityIdentifier)
>   IL_0010:  ret
>   IL_0011:  ldarg.1
>   IL_0012:  ldnull
>   IL_0013:  call       bool System.Security.Principal.SecurityIdentifier::op_Equality(class System.Security.Principal.SecurityIdentifier,
>                                                                                       class System.Security.Principal.SecurityIdentifier)
>   IL_0018:  brfalse.s  IL_001c
>   IL_001a:  ldc.i4.0
>   IL_001b:  ret
>   IL_001c:  ldarg.0
>   IL_001d:  callvirt   instance string System.Security.Principal.IdentityReference::get_Value()
>   IL_0022:  ldarg.1
>   IL_0023:  callvirt   instance string System.Security.Principal.IdentityReference::get_Value()
>   IL_0028:  call       bool System.String::op_Equality(string,
>                                                        string)
>   IL_002d:  ret
> ----
> 
> i don't think i use those two functions, 

Probably no one use them, at least successfully, since it only a partial
implementation (see the MonoTODO on the class definition).

> but just curious if others have seen this.  am i missing something?  :)
> 
> thx,
> bruce
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
-- 
Sebastien Pouliot  <sebastien at ximian.com>
Blog: http://pages.infinit.net/ctech/



More information about the Mono-list mailing list