Add Mutex creation extension methods that take an ACL (dotnet/corefx#42281)
authorCarlos Sanchez Lopez <1175054+carlossanlop@users.noreply.github.com>
Thu, 7 Nov 2019 01:05:31 +0000 (17:05 -0800)
committerGitHub <noreply@github.com>
Thu, 7 Nov 2019 01:05:31 +0000 (17:05 -0800)
commit66decde8e79ddd547569e9e305719f4130f3283c
treed40bf9ee74e6fd8eae28f59b899bf8e0e166719d
parent01fcd653270853b124502869af3aa4b160ef2388
Add Mutex creation extension methods that take an ACL (dotnet/corefx#42281)

Approved API Proposal: dotnet/corefx#41662

Description
We don't currently have a way to create a Mutex with a given ACL in .NET Core. We can modify the ACL, but it would be more secure to have the proper ACL on the object from the start.

Customer impact
Before this change, customers had to create a Mutex, then set its ACLs. This presents a few problems:

Potential security hole as mutexes can be accessed between creation and modification.
Porting difficulties as there isn't a 1-1 API replacement
This change addresses those problems by adding a new extension method that allows creating a Mutex and ensuring the provided ACLs are set during creation.

Commit migrated from https://github.com/dotnet/corefx/commit/46edc58620f29557e23fea29ed8392a0f2c9e31c
src/libraries/System.Threading.AccessControl/System.Threading.AccessControl.sln
src/libraries/System.Threading.AccessControl/ref/System.Threading.AccessControl.cs
src/libraries/System.Threading.AccessControl/src/Resources/Strings.resx
src/libraries/System.Threading.AccessControl/src/System.Threading.AccessControl.csproj
src/libraries/System.Threading.AccessControl/src/System/Threading/MutexAcl.cs [new file with mode: 0644]
src/libraries/System.Threading.AccessControl/src/System/Threading/MutexAcl.net46.cs [new file with mode: 0644]
src/libraries/System.Threading.AccessControl/tests/AclTests.cs [new file with mode: 0644]
src/libraries/System.Threading.AccessControl/tests/MutexAclTests.cs [new file with mode: 0644]
src/libraries/System.Threading.AccessControl/tests/System.Threading.AccessControl.Tests.csproj