Author: spouliot
Date: 2005-06-22 14:38:14 -0400 (Wed, 22 Jun 2005)
New Revision: 46379
Modified:
trunk/mcs/class/corlib/System.IO.IsolatedStorage/ChangeLog
trunk/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFile.cs
Log:
2005-06-22 Sebastien Pouliot <[EMAIL PROTECTED]>
* IsolatedStorageFile.cs: Only assembly evidences are considered to
resolve policy. Changed resolve method used (instead of changing it's
code).
Modified: trunk/mcs/class/corlib/System.IO.IsolatedStorage/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.IO.IsolatedStorage/ChangeLog 2005-06-22
18:35:41 UTC (rev 46378)
+++ trunk/mcs/class/corlib/System.IO.IsolatedStorage/ChangeLog 2005-06-22
18:38:14 UTC (rev 46379)
@@ -1,3 +1,9 @@
+2005-06-22 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * IsolatedStorageFile.cs: Only assembly evidences are considered to
+ resolve policy. Changed resolve method used (instead of changing it's
+ code).
+
2005-06-14 Sebastien Pouliot <[EMAIL PROTECTED]>
* IsolatedStorageFileStream.cs: Remove Close method from NET_2_0.
Modified:
trunk/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFile.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFile.cs
2005-06-22 18:35:41 UTC (rev 46378)
+++ trunk/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFile.cs
2005-06-22 18:38:14 UTC (rev 46379)
@@ -121,13 +121,16 @@
{
Demand (scope);
- if (((scope & IsolatedStorageScope.Domain) != 0) &&
(domainIdentity == null))
+ if (((scope & IsolatedStorageScope.Domain) != 0) &&
(domainIdentity == null))
throw new ArgumentNullException
("domainIdentity");
- if (((scope & IsolatedStorageScope.Assembly) != 0) &&
(assemblyIdentity == null))
+ bool assembly = ((scope &
IsolatedStorageScope.Assembly) != 0);
+ if (assembly && (assemblyIdentity == null))
throw new ArgumentNullException
("assemblyIdentity");
IsolatedStorageFile storageFile = new
IsolatedStorageFile (scope);
+ if (assembly)
+ storageFile._fullEvidences =
Assembly.GetCallingAssembly ().UnprotectedGetEvidence ();
storageFile._domainIdentity = domainIdentity;
storageFile._assemblyIdentity = assemblyIdentity;
storageFile.PostInit ();
@@ -143,6 +146,7 @@
}
if ((scope & IsolatedStorageScope.Assembly) != 0) {
Evidence e = Assembly.GetCallingAssembly
().UnprotectedGetEvidence ();
+ storageFile._fullEvidences = e;
storageFile._assemblyIdentity =
GetTypeFromEvidence (e, assemblyEvidenceType);
}
storageFile.PostInit ();
@@ -157,6 +161,7 @@
IsolatedStorageFile storageFile = new
IsolatedStorageFile (scope);
storageFile._applicationIdentity = applicationIdentity;
+ storageFile._fullEvidences =
Assembly.GetCallingAssembly ().UnprotectedGetEvidence ();
storageFile.PostInit ();
return storageFile;
}
@@ -166,6 +171,7 @@
Demand (scope);
IsolatedStorageFile storageFile = new
IsolatedStorageFile (scope);
storageFile.InitStore (scope, applicationEvidenceType);
+ storageFile._fullEvidences =
Assembly.GetCallingAssembly ().UnprotectedGetEvidence ();
storageFile.PostInit ();
return storageFile;
}
@@ -176,6 +182,7 @@
IsolatedStorageScope scope =
IsolatedStorageScope.Machine | IsolatedStorageScope.Application;
IsolatedStorageFile storageFile = new
IsolatedStorageFile (scope);
storageFile.InitStore (scope, null);
+ storageFile._fullEvidences =
Assembly.GetCallingAssembly ().UnprotectedGetEvidence ();
storageFile.PostInit ();
return storageFile;
}
@@ -211,6 +218,7 @@
IsolatedStorageScope scope = IsolatedStorageScope.User
| IsolatedStorageScope.Application;
IsolatedStorageFile storageFile = new
IsolatedStorageFile (scope);
storageFile.InitStore (scope, null);
+ storageFile._fullEvidences =
Assembly.GetCallingAssembly ().UnprotectedGetEvidence ();
storageFile.PostInit ();
return storageFile;
}
@@ -404,19 +412,16 @@
} else {
e = new Evidence ();
// otherwise use what was provided
- if (_domainIdentity != null)
- e.AddHost (_domainIdentity);
if (_assemblyIdentity != null)
e.AddHost (_assemblyIdentity);
- if (_applicationIdentity != null)
- e.AddHost
(_applicationIdentity);
}
if (e.Count < 1) {
throw new InvalidOperationException (
Locale.GetText ("Couldn't get
the quota from the available evidences."));
}
- PermissionSet ps =
SecurityManager.ResolvePolicy (e);
+ PermissionSet denied = null;
+ PermissionSet ps =
SecurityManager.ResolvePolicy (e, null, null, null, out denied);
IsolatedStoragePermission isp = GetPermission
(ps);
if (isp == null) {
if (ps.IsUnrestricted ()) {
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches