Author: spouliot
Date: 2006-08-08 08:24:50 -0400 (Tue, 08 Aug 2006)
New Revision: 63476
Modified:
trunk/mcs/class/corlib/System.Security.Principal/ChangeLog
trunk/mcs/class/corlib/System.Security.Principal/GenericIdentity.cs
trunk/mcs/class/corlib/System.Security.Principal/GenericPrincipal.cs
Log:
2006-08-08 Sebastien Pouliot <[EMAIL PROTECTED]>
* GenericIdentity.cs: Rename fields to match MS for serialization
(indirecly required to fix GenericPrincipal serialization). Also
renamed ctor parameters to match fx.
* GenericPrincipal.cs: Rename fields to match MS for serialization.
Fix bug #79030.
Modified: trunk/mcs/class/corlib/System.Security.Principal/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.Security.Principal/ChangeLog 2006-08-08
12:19:35 UTC (rev 63475)
+++ trunk/mcs/class/corlib/System.Security.Principal/ChangeLog 2006-08-08
12:24:50 UTC (rev 63476)
@@ -1,4 +1,11 @@
+2006-08-08 Sebastien Pouliot <[EMAIL PROTECTED]>
+ * GenericIdentity.cs: Rename fields to match MS for serialization
+ (indirecly required to fix GenericPrincipal serialization). Also
+ renamed ctor parameters to match fx.
+ * GenericPrincipal.cs: Rename fields to match MS for serialization.
+ Fix bug #79030.
+
Wed Nov 30 19:09:50 CET 2005 Paolo Molaro <[EMAIL PROTECTED]>
* WindowsIdentity.cs: remove check for an invalid user token on Posix
Modified: trunk/mcs/class/corlib/System.Security.Principal/GenericIdentity.cs
===================================================================
--- trunk/mcs/class/corlib/System.Security.Principal/GenericIdentity.cs
2006-08-08 12:19:35 UTC (rev 63475)
+++ trunk/mcs/class/corlib/System.Security.Principal/GenericIdentity.cs
2006-08-08 12:24:50 UTC (rev 63476)
@@ -5,7 +5,7 @@
// Miguel de Icaza ([EMAIL PROTECTED])
//
// (C) Ximian, Inc. http://www.ximian.com
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2006 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -36,40 +36,43 @@
[ComVisible (true)]
#endif
public class GenericIdentity : IIdentity {
- string user_name;
- string authentication_type;
+
+ // field names are serialization compatible with .net
+ private string m_name;
+ private string m_type;
- public GenericIdentity (string user_name, string
authentication_type)
+ public GenericIdentity (string name, string type)
{
- if (user_name == null)
- throw new ArgumentNullException ("user_name");
+ if (name == null)
+ throw new ArgumentNullException ("name");
- if (authentication_type == null)
- throw new ArgumentNullException
("authentication_type");
+ if (type == null)
+ throw new ArgumentNullException ("type");
- this.user_name = user_name;
- this.authentication_type = authentication_type;
+ m_name = name;
+ m_type = type;
}
- public GenericIdentity (string name) : this (name, "")
+ public GenericIdentity (string name)
+ : this (name, String.Empty)
{
}
public virtual string AuthenticationType {
get {
- return authentication_type;
+ return m_type;
}
}
public virtual string Name {
get {
- return user_name;
+ return m_name;
}
}
public virtual bool IsAuthenticated {
get {
- return (user_name != "");
+ return (m_name.Length > 0);
}
}
}
Modified: trunk/mcs/class/corlib/System.Security.Principal/GenericPrincipal.cs
===================================================================
--- trunk/mcs/class/corlib/System.Security.Principal/GenericPrincipal.cs
2006-08-08 12:19:35 UTC (rev 63475)
+++ trunk/mcs/class/corlib/System.Security.Principal/GenericPrincipal.cs
2006-08-08 12:24:50 UTC (rev 63476)
@@ -6,7 +6,7 @@
// Sebastien Pouliot <[EMAIL PROTECTED]>
//
// (C) Ximian, Inc. http://www.ximian.com
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2006 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -37,34 +37,36 @@
[ComVisible (true)]
#endif
public class GenericPrincipal : IPrincipal {
- IIdentity identity;
- string [] roles;
+
+ // field names are serialization compatible with .net
+ private IIdentity m_identity;
+ private string[] m_roles;
public GenericPrincipal (IIdentity identity, string [] roles)
{
if (identity == null)
throw new ArgumentNullException ("identity");
- this.identity = identity;
+ m_identity = identity;
if (roles != null) {
// make our own (unchangeable) copy of the roles
- this.roles = new string [roles.Length];
+ m_roles = new string [roles.Length];
for (int i=0; i < roles.Length; i++)
- this.roles [i] = roles [i];
+ m_roles [i] = roles [i];
}
}
public virtual IIdentity Identity {
- get { return identity; }
+ get { return m_identity; }
}
public virtual bool IsInRole (string role)
{
- if (roles == null)
+ if (m_roles == null)
return false;
int l = role.Length;
- foreach (string r in roles) {
+ foreach (string r in m_roles) {
if ((r != null) && (l == r.Length)) {
if (String.Compare (role, 0, r, 0, l,
true) == 0)
return true;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches