Wed Nov 30 19:09:50 CET 2005 Paolo Molaro <lupus@ximian.com>
authorPaolo Molaro <lupus@oddwiz.org>
Wed, 30 Nov 2005 18:26:58 +0000 (18:26 -0000)
committerPaolo Molaro <lupus@oddwiz.org>
Wed, 30 Nov 2005 18:26:58 +0000 (18:26 -0000)
* WindowsIdentity.cs: remove check for an invalid user token on Posix
systems and check for PlatformID.Unix, too.

svn path=/trunk/mcs/; revision=53701

mcs/class/corlib/System.Security.Principal/ChangeLog
mcs/class/corlib/System.Security.Principal/WindowsIdentity.cs

index c1ffd39649f1443d70c47d97f0b42f4910801ecd..dd0e7d72cc81747b9ceb3ca4b5e0418999ff4d58 100644 (file)
@@ -1,3 +1,9 @@
+
+Wed Nov 30 19:09:50 CET 2005 Paolo Molaro <lupus@ximian.com>
+
+       * WindowsIdentity.cs: remove check for an invalid user token on Posix
+       systems and check for PlatformID.Unix, too.
+
 2005-10-28  Sebastien Pouliot  <sebastien@ximian.com> 
 
        * IdentityReferenceCollection.cs: Removed virtual from Count and 
index d2fb73269503e3ec072d08742540b7576be66d55..535efdc986bc3ffbb5553d93446586e2d7464d19 100644 (file)
@@ -53,8 +53,6 @@ namespace System.Security.Principal {
                private SerializationInfo _info;
 
                static private IntPtr invalidWindows = IntPtr.Zero;
-               // that seems to be the value used for (at least) AIX and MacOSX
-               static private IntPtr invalidPosix = (IntPtr) unchecked (-2);
 
                [SecurityPermission (SecurityAction.Demand, ControlPrincipal=true)]
                public WindowsIdentity (IntPtr userToken) 
@@ -289,14 +287,12 @@ namespace System.Security.Principal {
                }
 #endif
                private static bool IsPosix {
-                       get { return ((int) Environment.Platform == 128); }
+                       get { return ((int) Environment.Platform == 128) || ((int)Environment.Platform == 4); }
                }
 
                private void SetToken (IntPtr token) 
                {
                        if (IsPosix) {
-                               if (token == invalidPosix)
-                                       throw new ArgumentException ("Invalid token");
 
                                _token = token;
                                // apply defaults