Parcourir la source

2005-09-02 Sebastien Pouliot <[email protected]>

	* Cache.cs: Added security permissions with Minimal level for
	AspNetHostingPermissionLevel (only LinkDemand as the class is sealed).
	* CacheDependency.cs: : Added security permissions with Minimal level 
	for AspNetHostingPermissionLevel (note class is sealed only in 1.x).



svn path=/trunk/mcs/; revision=49342
Sebastien Pouliot il y a 20 ans
Parent
commit
96205ff6c0

+ 3 - 1
mcs/class/System.Web/System.Web.Caching/Cache.cs

@@ -27,12 +27,14 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-using System;
 using System.Threading;
 using System.Collections;
+using System.Security.Permissions;
 
 namespace System.Web.Caching
 {
+	// CAS - no InheritanceDemand here as the class is sealed
+	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public sealed class Cache: IEnumerable
 	{
 		Hashtable cache;

+ 11 - 2
mcs/class/System.Web/System.Web.Caching/CacheDependency.cs

@@ -29,11 +29,20 @@
 
 using System.Collections;
 using System.IO;
+using System.Security.Permissions;
 
 namespace System.Web.Caching
 {
-	public sealed class CacheDependency: IDisposable
-	{
+#if NET_2_0
+	// CAS
+	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+	public class CacheDependency: IDisposable {
+#else
+	// CAS - no InheritanceDemand here as the class is sealed
+	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+	public sealed class CacheDependency: IDisposable {
+#endif
 		string[] cachekeys;
 		CacheDependency dependency;
 		DateTime start;

+ 8 - 1
mcs/class/System.Web/System.Web.Caching/ChangeLog

@@ -1,3 +1,10 @@
+2005-09-02  Sebastien Pouliot  <[email protected]>
+
+	* Cache.cs: Added security permissions with Minimal level for
+	AspNetHostingPermissionLevel (only LinkDemand as the class is sealed).
+	* CacheDependency.cs: : Added security permissions with Minimal level 
+	for AspNetHostingPermissionLevel (note class is sealed only in 1.x).
+
 2005-09-01 Eyal Alaluf <[email protected]>
 	* CacheDependency.cs: TARGET_J2EE fixes.
 
@@ -34,7 +41,7 @@
 	* CacheDependency.cs - added TARGET_JVM directives in places,
 	  where file watching is using (Mainsoft's implementation currently
 	  doesn't support the feature).
-	  
+
 2005-05-09 Gonzalo Paniagua Javier <[email protected]>
 
 	* CacheEntry.cs: credits for this patch should go to mcs. it catched