From: Sebastien Pouliot Date: Tue, 19 May 2015 22:11:13 +0000 (-0400) Subject: Sprinkle some DISABLE_CAS_USE for System.ServiceModel.* helpers X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=8bfb3e21781100ad73efa0c0483f213bac5460e9;p=mono.git Sprinkle some DISABLE_CAS_USE for System.ServiceModel.* helpers --- diff --git a/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/PartialTrustHelpers.cs b/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/PartialTrustHelpers.cs index 4b8bf564682..47847089c94 100644 --- a/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/PartialTrustHelpers.cs +++ b/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/PartialTrustHelpers.cs @@ -36,6 +36,9 @@ namespace System.Runtime [SecurityCritical] internal static bool IsInFullTrust() { +#if DISABLE_CAS_USE + return true; +#else if (!SecurityManager.CurrentThreadRequiresSecurityContextCapture()) { return true; @@ -50,6 +53,7 @@ namespace System.Runtime { return false; } +#endif } [Fx.Tag.SecurityNote(Critical = "Captures security context with identity flow suppressed, " + @@ -110,17 +114,25 @@ namespace System.Runtime [SecurityCritical] internal static bool CheckAppDomainPermissions(PermissionSet permissions) { +#if DISABLE_CAS_USE + return true; +#else return AppDomain.CurrentDomain.IsHomogenous && permissions.IsSubsetOf(AppDomain.CurrentDomain.PermissionSet); +#endif } [Fx.Tag.SecurityNote(Critical = "used in a security-sensitive decision")] [SecurityCritical] internal static bool HasEtwPermissions() { +#if DISABLE_CAS_USE + return true; +#else //Currently unrestricted permissions are required to create Etw provider. PermissionSet permissions = new PermissionSet(PermissionState.Unrestricted); return CheckAppDomainPermissions(permissions); +#endif } internal static bool AppDomainFullyTrusted @@ -130,6 +142,9 @@ namespace System.Runtime [SecuritySafeCritical] get { +#if DISABLE_CAS_USE + return true; +#else if (!checkedForFullTrust) { inFullTrust = AppDomain.CurrentDomain.IsFullyTrusted; @@ -137,6 +152,7 @@ namespace System.Runtime } return inFullTrust; +#endif } } }