Add Semaphore creation extension methods that take an ACL (#42377)
commit229d3cc09754a4ef83a345a491abe1c78e294f69
authorCarlos Sanchez Lopez <1175054+carlossanlop@users.noreply.github.com>
Fri, 8 Nov 2019 00:27:37 +0000 (7 16:27 -0800)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Fri, 8 Nov 2019 00:59:07 +0000 (8 01:59 +0100)
treee770d65fe669b243cbe75ff26eb796aa68066d0e
parentc0a9d6bf7622cebacd1c1d56a56db9b0a5edab20
Add Semaphore creation extension methods that take an ACL (#42377)

Approved API Proposal: #41662

Description
We don't currently have a way to create a Semaphore 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 Semaphore, then set its ACLs. This presents a few problems:
- Potential security hole as semaphores 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 Semaphore and ensuring the provided ACLs are set during creation.

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.Semaphore.cs