You've already forked linux-packaging-mono
Imported Upstream version 5.4.0.167
Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
This commit is contained in:
parent
e49d6f06c0
commit
536cd135cc
@ -2,7 +2,7 @@
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\dir.props" />
|
||||
<PropertyGroup>
|
||||
<AssemblyVersion>4.0.2.0</AssemblyVersion>
|
||||
<IsDesktopFacade>true</IsDesktopFacade>
|
||||
<AssemblyVersion>4.0.3.0</AssemblyVersion>
|
||||
<AssemblyKey>MSFT</AssemblyKey>
|
||||
</PropertyGroup>
|
||||
</Project>
|
@ -3,12 +3,18 @@
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ref\System.Threading.AccessControl.csproj">
|
||||
<SupportedFramework>net46;netcoreapp1.0</SupportedFramework>
|
||||
<SupportedFramework>net461;netcoreapp2.0;$(AllXamarinFrameworks)</SupportedFramework>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\src\System.Threading.AccessControl.csproj" />
|
||||
<NotSupportedOnTargetFramework Include="netcore50">
|
||||
<PackageTargetRuntime>win</PackageTargetRuntime>
|
||||
</NotSupportedOnTargetFramework>
|
||||
<HarvestIncludePaths Include="ref/net46;lib/net46;runtimes/win/lib/net46" />
|
||||
<HarvestIncludePaths Include="ref/netstandard1.3">
|
||||
<SupportedFramework>netcore50</SupportedFramework>
|
||||
</HarvestIncludePaths>
|
||||
<HarvestIncludePaths Include="runtimes/win/lib/netstandard1.3" />
|
||||
<HarvestIncludePaths Include="runtimes/unix/lib/netstandard1.3">
|
||||
<!-- package unix impl (platform not supported) as RID agnostic -->
|
||||
<TargetPath>lib/netstandard1.3</TargetPath>
|
||||
</HarvestIncludePaths>
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
@ -3,6 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<BuildConfigurations>
|
||||
netstandard;
|
||||
netfx;
|
||||
</BuildConfigurations>
|
||||
</PropertyGroup>
|
||||
</Project>
|
@ -9,7 +9,6 @@
|
||||
namespace System.Security.AccessControl
|
||||
{
|
||||
[System.FlagsAttribute]
|
||||
[System.Security.SecurityCriticalAttribute]
|
||||
public enum EventWaitHandleRights
|
||||
{
|
||||
ChangePermissions = 262144,
|
||||
@ -21,7 +20,6 @@ namespace System.Security.AccessControl
|
||||
TakeOwnership = 524288,
|
||||
}
|
||||
|
||||
[System.Security.SecurityCriticalAttribute]
|
||||
public sealed partial class EventWaitHandleSecurity : System.Security.AccessControl.NativeObjectSecurity
|
||||
{
|
||||
public EventWaitHandleSecurity() : base(default(bool), default(System.Security.AccessControl.ResourceType)) { }
|
||||
|
@ -8,34 +8,29 @@
|
||||
|
||||
namespace System.Security.AccessControl
|
||||
{
|
||||
[System.Security.SecurityCriticalAttribute]
|
||||
public sealed partial class EventWaitHandleAccessRule : System.Security.AccessControl.AccessRule
|
||||
{
|
||||
public EventWaitHandleAccessRule(System.Security.Principal.IdentityReference identity, System.Security.AccessControl.EventWaitHandleRights eventRights, System.Security.AccessControl.AccessControlType type) : base(default(System.Security.Principal.IdentityReference), default(int), default(bool), default(System.Security.AccessControl.InheritanceFlags), default(System.Security.AccessControl.PropagationFlags), default(System.Security.AccessControl.AccessControlType)) { }
|
||||
public EventWaitHandleAccessRule(string identity, System.Security.AccessControl.EventWaitHandleRights eventRights, System.Security.AccessControl.AccessControlType type) : base(default(System.Security.Principal.IdentityReference), default(int), default(bool), default(System.Security.AccessControl.InheritanceFlags), default(System.Security.AccessControl.PropagationFlags), default(System.Security.AccessControl.AccessControlType)) { }
|
||||
public System.Security.AccessControl.EventWaitHandleRights EventWaitHandleRights { get { throw null; } }
|
||||
}
|
||||
[System.Security.SecurityCriticalAttribute]
|
||||
public sealed partial class EventWaitHandleAuditRule : System.Security.AccessControl.AuditRule
|
||||
{
|
||||
public EventWaitHandleAuditRule(System.Security.Principal.IdentityReference identity, System.Security.AccessControl.EventWaitHandleRights eventRights, System.Security.AccessControl.AuditFlags flags) : base(default(System.Security.Principal.IdentityReference), default(int), default(bool), default(System.Security.AccessControl.InheritanceFlags), default(System.Security.AccessControl.PropagationFlags), default(System.Security.AccessControl.AuditFlags)) { }
|
||||
public System.Security.AccessControl.EventWaitHandleRights EventWaitHandleRights { get { throw null; } }
|
||||
}
|
||||
[System.Security.SecurityCriticalAttribute]
|
||||
public sealed partial class MutexAccessRule : System.Security.AccessControl.AccessRule
|
||||
{
|
||||
public MutexAccessRule(System.Security.Principal.IdentityReference identity, System.Security.AccessControl.MutexRights eventRights, System.Security.AccessControl.AccessControlType type) : base(default(System.Security.Principal.IdentityReference), default(int), default(bool), default(System.Security.AccessControl.InheritanceFlags), default(System.Security.AccessControl.PropagationFlags), default(System.Security.AccessControl.AccessControlType)) { }
|
||||
public MutexAccessRule(string identity, System.Security.AccessControl.MutexRights eventRights, System.Security.AccessControl.AccessControlType type) : base(default(System.Security.Principal.IdentityReference), default(int), default(bool), default(System.Security.AccessControl.InheritanceFlags), default(System.Security.AccessControl.PropagationFlags), default(System.Security.AccessControl.AccessControlType)) { }
|
||||
public System.Security.AccessControl.MutexRights MutexRights { get { throw null; } }
|
||||
}
|
||||
[System.Security.SecurityCriticalAttribute]
|
||||
public sealed partial class MutexAuditRule : System.Security.AccessControl.AuditRule
|
||||
{
|
||||
public MutexAuditRule(System.Security.Principal.IdentityReference identity, System.Security.AccessControl.MutexRights eventRights, System.Security.AccessControl.AuditFlags flags) : base(default(System.Security.Principal.IdentityReference), default(int), default(bool), default(System.Security.AccessControl.InheritanceFlags), default(System.Security.AccessControl.PropagationFlags), default(System.Security.AccessControl.AuditFlags)) { }
|
||||
public System.Security.AccessControl.MutexRights MutexRights { get { throw null; } }
|
||||
}
|
||||
[System.FlagsAttribute]
|
||||
[System.Security.SecurityCriticalAttribute]
|
||||
public enum MutexRights
|
||||
{
|
||||
ChangePermissions = 262144,
|
||||
@ -46,7 +41,6 @@ namespace System.Security.AccessControl
|
||||
Synchronize = 1048576,
|
||||
TakeOwnership = 524288,
|
||||
}
|
||||
[System.Security.SecurityCriticalAttribute]
|
||||
public sealed partial class MutexSecurity : System.Security.AccessControl.NativeObjectSecurity
|
||||
{
|
||||
public MutexSecurity() : base(default(bool), default(System.Security.AccessControl.ResourceType)) { }
|
||||
@ -68,21 +62,18 @@ namespace System.Security.AccessControl
|
||||
public void SetAccessRule(System.Security.AccessControl.MutexAccessRule rule) { }
|
||||
public void SetAuditRule(System.Security.AccessControl.MutexAuditRule rule) { }
|
||||
}
|
||||
[System.Security.SecurityCriticalAttribute]
|
||||
public sealed partial class SemaphoreAccessRule : System.Security.AccessControl.AccessRule
|
||||
{
|
||||
public SemaphoreAccessRule(System.Security.Principal.IdentityReference identity, System.Security.AccessControl.SemaphoreRights eventRights, System.Security.AccessControl.AccessControlType type) : base(default(System.Security.Principal.IdentityReference), default(int), default(bool), default(System.Security.AccessControl.InheritanceFlags), default(System.Security.AccessControl.PropagationFlags), default(System.Security.AccessControl.AccessControlType)) { }
|
||||
public SemaphoreAccessRule(string identity, System.Security.AccessControl.SemaphoreRights eventRights, System.Security.AccessControl.AccessControlType type) : base(default(System.Security.Principal.IdentityReference), default(int), default(bool), default(System.Security.AccessControl.InheritanceFlags), default(System.Security.AccessControl.PropagationFlags), default(System.Security.AccessControl.AccessControlType)) { }
|
||||
public System.Security.AccessControl.SemaphoreRights SemaphoreRights { get { throw null; } }
|
||||
}
|
||||
[System.Security.SecurityCriticalAttribute]
|
||||
public sealed partial class SemaphoreAuditRule : System.Security.AccessControl.AuditRule
|
||||
{
|
||||
public SemaphoreAuditRule(System.Security.Principal.IdentityReference identity, System.Security.AccessControl.SemaphoreRights eventRights, System.Security.AccessControl.AuditFlags flags) : base(default(System.Security.Principal.IdentityReference), default(int), default(bool), default(System.Security.AccessControl.InheritanceFlags), default(System.Security.AccessControl.PropagationFlags), default(System.Security.AccessControl.AuditFlags)) { }
|
||||
public System.Security.AccessControl.SemaphoreRights SemaphoreRights { get { throw null; } }
|
||||
}
|
||||
[System.FlagsAttribute]
|
||||
[System.Security.SecurityCriticalAttribute]
|
||||
public enum SemaphoreRights
|
||||
{
|
||||
ChangePermissions = 262144,
|
||||
@ -93,7 +84,6 @@ namespace System.Security.AccessControl
|
||||
Synchronize = 1048576,
|
||||
TakeOwnership = 524288,
|
||||
}
|
||||
[System.Security.SecurityCriticalAttribute]
|
||||
public sealed partial class SemaphoreSecurity : System.Security.AccessControl.NativeObjectSecurity
|
||||
{
|
||||
public SemaphoreSecurity() : base(default(bool), default(System.Security.AccessControl.ResourceType)) { }
|
||||
@ -118,7 +108,6 @@ namespace System.Security.AccessControl
|
||||
}
|
||||
namespace System.Threading
|
||||
{
|
||||
[System.Security.SecurityCriticalAttribute]
|
||||
public static partial class ThreadingAclExtensions
|
||||
{
|
||||
public static System.Security.AccessControl.EventWaitHandleSecurity GetAccessControl(this System.Threading.EventWaitHandle handle) { throw null; }
|
||||
|
@ -3,14 +3,21 @@
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{C2B1A23B-16F9-4015-BE3C-DD871A7C108D}</ProjectGuid>
|
||||
<IsPartialFacadeAssembly Condition="'$(TargetGroup)' == 'netfx'">true</IsPartialFacadeAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
|
||||
<ItemGroup>
|
||||
<Compile Include="System.Threading.AccessControl.cs" />
|
||||
<Compile Include="System.Threading.AccessControl.Manual.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ItemGroup Condition="'$(TargetGroup)' == 'netfx'">
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(TargetGroup)' != 'netfx'">
|
||||
<ProjectReference Include="..\..\System.Security.AccessControl\ref\System.Security.AccessControl.csproj" />
|
||||
<ProjectReference Include="..\..\System.Security.Principal.Windows\ref\System.Security.Principal.Windows.csproj" />
|
||||
</ItemGroup>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<BuildConfigurations>
|
||||
netfx-Windows_NT;
|
||||
netstandard-Windows_NT;
|
||||
netstandard-Unix;
|
||||
netstandard;
|
||||
</BuildConfigurations>
|
||||
</PropertyGroup>
|
||||
</Project>
|
@ -61,4 +61,7 @@
|
||||
<data name="WaitHandleCannotBeOpenedException_InvalidHandle" xml:space="preserve">
|
||||
<value>A WaitHandle with system-wide name '{0}' cannot be created. A WaitHandle of a different type might have the same name.</value>
|
||||
</data>
|
||||
<data name="PlatformNotSupported_AccessControl" xml:space="preserve">
|
||||
<value>Access Control List (ACL) APIs are part of resource management on Windows and are not supported on this platform.</value>
|
||||
</data>
|
||||
</root>
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
|
||||
<PropertyGroup>
|
||||
<OSGroup Condition="'$(OSGroup)' == ''">Windows_NT</OSGroup>
|
||||
@ -7,16 +7,16 @@
|
||||
<PropertyGroup>
|
||||
<AssemblyName>System.Threading.AccessControl</AssemblyName>
|
||||
<ProjectGuid>{E3ED83FD-3015-4BD8-A1B8-6294986E6CFA}</ProjectGuid>
|
||||
<GeneratePlatformNotSupportedAssembly Condition="'$(TargetsUnix)' == 'true'">true</GeneratePlatformNotSupportedAssembly>
|
||||
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetGroup)' == 'netstandard' AND '$(TargetsWindows)' != 'true'">SR.PlatformNotSupported_AccessControl</GeneratePlatformNotSupportedAssemblyMessage>
|
||||
<IsPartialFacadeAssembly Condition="'$(TargetGroup)'=='netfx'">true</IsPartialFacadeAssembly>
|
||||
</PropertyGroup>
|
||||
<!-- Default configurations to help VS understand the options -->
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netfx-Windows_NT-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netfx-Windows_NT-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netstandard-Windows_NT-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netstandard-Windows_NT-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netstandard-Unix-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netstandard-Unix-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Windows_NT-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Windows_NT-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Release|AnyCPU'" />
|
||||
<ItemGroup Condition="'$(TargetGroup)'=='netstandard' AND '$(TargetsWindows)'=='true'">
|
||||
<Compile Include="$(CommonPath)\Interop\Windows\Interop.Errors.cs">
|
||||
<Link>Common\Interop\Windows\Interop.Errors.cs</Link>
|
||||
@ -36,4 +36,4 @@
|
||||
<Reference Include="System.Security.Principal.Windows" />
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
||||
</Project>
|
@ -13,11 +13,11 @@
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Principal;
|
||||
using System.Threading;
|
||||
using Microsoft.Win32;
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
|
||||
namespace System.Security.AccessControl
|
||||
{
|
||||
@ -115,22 +115,19 @@ namespace System.Security.AccessControl
|
||||
{
|
||||
}
|
||||
|
||||
[System.Security.SecurityCritical] // auto-generated
|
||||
internal EventWaitHandleSecurity(String name, AccessControlSections includeSections)
|
||||
: base(true, ResourceType.KernelObject, name, includeSections, _HandleErrorCode, null)
|
||||
: base(true, ResourceType.KernelObject, name, includeSections, HandleErrorCode, null)
|
||||
{
|
||||
// Let the underlying ACL API's demand unmanaged code permission.
|
||||
}
|
||||
|
||||
[System.Security.SecurityCritical] // auto-generated
|
||||
internal EventWaitHandleSecurity(SafeWaitHandle handle, AccessControlSections includeSections)
|
||||
: base(true, ResourceType.KernelObject, handle, includeSections, _HandleErrorCode, null)
|
||||
: base(true, ResourceType.KernelObject, handle, includeSections, HandleErrorCode, null)
|
||||
{
|
||||
// Let the underlying ACL API's demand unmanaged code permission.
|
||||
}
|
||||
|
||||
[System.Security.SecurityCritical] // auto-generated
|
||||
private static Exception _HandleErrorCode(int errorCode, string name, SafeHandle handle, object context)
|
||||
private static Exception HandleErrorCode(int errorCode, string name, SafeHandle handle, object context)
|
||||
{
|
||||
System.Exception exception = null;
|
||||
|
||||
@ -144,9 +141,6 @@ namespace System.Security.AccessControl
|
||||
else
|
||||
exception = new WaitHandleCannotBeOpenedException();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return exception;
|
||||
@ -166,7 +160,7 @@ namespace System.Security.AccessControl
|
||||
{
|
||||
AccessControlSections persistRules = AccessControlSections.None;
|
||||
if (AccessRulesModified)
|
||||
persistRules = AccessControlSections.Access;
|
||||
persistRules |= AccessControlSections.Access;
|
||||
if (AuditRulesModified)
|
||||
persistRules |= AccessControlSections.Audit;
|
||||
if (OwnerModified)
|
||||
@ -176,7 +170,6 @@ namespace System.Security.AccessControl
|
||||
return persistRules;
|
||||
}
|
||||
|
||||
[System.Security.SecurityCritical] // auto-generated
|
||||
internal void Persist(SafeWaitHandle handle)
|
||||
{
|
||||
//
|
||||
|
@ -13,11 +13,11 @@
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Principal;
|
||||
using System.Threading;
|
||||
using Microsoft.Win32;
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
|
||||
namespace System.Security.AccessControl
|
||||
{
|
||||
@ -90,13 +90,6 @@ namespace System.Security.AccessControl
|
||||
{
|
||||
}
|
||||
|
||||
/* // Not in the spec
|
||||
public MutexAuditRule(string identity, MutexRights eventRights, AuditFlags flags)
|
||||
: this(new NTAccount(identity), (int) eventRights, false, InheritanceFlags.None, PropagationFlags.None, flags)
|
||||
{
|
||||
}
|
||||
*/
|
||||
|
||||
internal MutexAuditRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
|
||||
: base(identity, accessMask, isInherited, inheritanceFlags, propagationFlags, flags)
|
||||
{
|
||||
@ -116,22 +109,19 @@ namespace System.Security.AccessControl
|
||||
{
|
||||
}
|
||||
|
||||
[System.Security.SecuritySafeCritical] // auto-generated
|
||||
public MutexSecurity(String name, AccessControlSections includeSections)
|
||||
: base(true, ResourceType.KernelObject, name, includeSections, _HandleErrorCode, null)
|
||||
: base(true, ResourceType.KernelObject, name, includeSections, HandleErrorCode, null)
|
||||
{
|
||||
// Let the underlying ACL API's demand unmanaged code permission.
|
||||
}
|
||||
|
||||
[System.Security.SecurityCritical] // auto-generated
|
||||
internal MutexSecurity(SafeWaitHandle handle, AccessControlSections includeSections)
|
||||
: base(true, ResourceType.KernelObject, handle, includeSections, _HandleErrorCode, null)
|
||||
: base(true, ResourceType.KernelObject, handle, includeSections, HandleErrorCode, null)
|
||||
{
|
||||
// Let the underlying ACL API's demand unmanaged code permission.
|
||||
}
|
||||
|
||||
[System.Security.SecurityCritical] // auto-generated
|
||||
private static Exception _HandleErrorCode(int errorCode, string name, SafeHandle handle, object context)
|
||||
private static Exception HandleErrorCode(int errorCode, string name, SafeHandle handle, object context)
|
||||
{
|
||||
System.Exception exception = null;
|
||||
|
||||
@ -145,9 +135,6 @@ namespace System.Security.AccessControl
|
||||
else
|
||||
exception = new WaitHandleCannotBeOpenedException();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return exception;
|
||||
@ -167,7 +154,7 @@ namespace System.Security.AccessControl
|
||||
{
|
||||
AccessControlSections persistRules = AccessControlSections.None;
|
||||
if (AccessRulesModified)
|
||||
persistRules = AccessControlSections.Access;
|
||||
persistRules |= AccessControlSections.Access;
|
||||
if (AuditRulesModified)
|
||||
persistRules |= AccessControlSections.Audit;
|
||||
if (OwnerModified)
|
||||
@ -177,7 +164,6 @@ namespace System.Security.AccessControl
|
||||
return persistRules;
|
||||
}
|
||||
|
||||
[System.Security.SecurityCritical] // auto-generated
|
||||
internal void Persist(SafeWaitHandle handle)
|
||||
{
|
||||
// Let the underlying ACL API's demand unmanaged code.
|
||||
|
@ -12,11 +12,11 @@
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Principal;
|
||||
using System.Threading;
|
||||
using Microsoft.Win32;
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
|
||||
namespace System.Security.AccessControl
|
||||
{
|
||||
@ -85,13 +85,6 @@ namespace System.Security.AccessControl
|
||||
{
|
||||
}
|
||||
|
||||
/* // Not in the spec
|
||||
public SemaphoreAuditRule(string identity, SemaphoreRights eventRights, AuditFlags flags)
|
||||
: this(new NTAccount(identity), (int) eventRights, false, InheritanceFlags.None, PropagationFlags.None, flags)
|
||||
{
|
||||
}
|
||||
*/
|
||||
|
||||
internal SemaphoreAuditRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
|
||||
: base(identity, accessMask, isInherited, inheritanceFlags, propagationFlags, flags)
|
||||
{
|
||||
@ -111,18 +104,18 @@ namespace System.Security.AccessControl
|
||||
}
|
||||
|
||||
public SemaphoreSecurity(String name, AccessControlSections includeSections)
|
||||
: base(true, ResourceType.KernelObject, name, includeSections, _HandleErrorCode, null)
|
||||
: base(true, ResourceType.KernelObject, name, includeSections, HandleErrorCode, null)
|
||||
{
|
||||
// Let the underlying ACL API's demand unmanaged code permission.
|
||||
}
|
||||
|
||||
internal SemaphoreSecurity(SafeWaitHandle handle, AccessControlSections includeSections)
|
||||
: base(true, ResourceType.KernelObject, handle, includeSections, _HandleErrorCode, null)
|
||||
: base(true, ResourceType.KernelObject, handle, includeSections, HandleErrorCode, null)
|
||||
{
|
||||
// Let the underlying ACL API's demand unmanaged code permission.
|
||||
}
|
||||
|
||||
private static Exception _HandleErrorCode(int errorCode, string name, SafeHandle handle, object context)
|
||||
private static Exception HandleErrorCode(int errorCode, string name, SafeHandle handle, object context)
|
||||
{
|
||||
System.Exception exception = null;
|
||||
|
||||
@ -136,9 +129,6 @@ namespace System.Security.AccessControl
|
||||
else
|
||||
exception = new WaitHandleCannotBeOpenedException();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return exception;
|
||||
@ -158,7 +148,7 @@ namespace System.Security.AccessControl
|
||||
{
|
||||
AccessControlSections persistRules = AccessControlSections.None;
|
||||
if (AccessRulesModified)
|
||||
persistRules = AccessControlSections.Access;
|
||||
persistRules |= AccessControlSections.Access;
|
||||
if (AuditRulesModified)
|
||||
persistRules |= AccessControlSections.Audit;
|
||||
if (OwnerModified)
|
||||
|
@ -2,8 +2,6 @@
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
// Ported from EventWaitHandle.cs, Mutex.cs, Semaphore.cs and made extension methods (or renamed statics, where necessary) to allow
|
||||
// extending the class without System.Threading needing to rely on System.Security.AccessControl
|
||||
|
||||
@ -15,13 +13,11 @@ namespace System.Threading
|
||||
{
|
||||
public static class ThreadingAclExtensions
|
||||
{
|
||||
[System.Security.SecuritySafeCritical] // auto-generated
|
||||
public static EventWaitHandleSecurity GetAccessControl(this EventWaitHandle handle)
|
||||
{
|
||||
return new EventWaitHandleSecurity(handle.GetSafeWaitHandle(), AccessControlSections.Access | AccessControlSections.Owner | AccessControlSections.Group);
|
||||
}
|
||||
|
||||
[System.Security.SecuritySafeCritical] // auto-generated
|
||||
public static void SetAccessControl(this EventWaitHandle handle, EventWaitHandleSecurity eventSecurity)
|
||||
{
|
||||
if (eventSecurity == null)
|
||||
@ -31,13 +27,11 @@ namespace System.Threading
|
||||
eventSecurity.Persist(handle.GetSafeWaitHandle());
|
||||
}
|
||||
|
||||
[System.Security.SecuritySafeCritical] // auto-generated
|
||||
public static MutexSecurity GetAccessControl(this Mutex mutex)
|
||||
{
|
||||
return new MutexSecurity(mutex.GetSafeWaitHandle(), AccessControlSections.Access | AccessControlSections.Owner | AccessControlSections.Group);
|
||||
}
|
||||
|
||||
[System.Security.SecuritySafeCritical] // auto-generated
|
||||
public static void SetAccessControl(this Mutex mutex, MutexSecurity mutexSecurity)
|
||||
{
|
||||
if (mutexSecurity == null)
|
||||
|
Reference in New Issue
Block a user