Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

@carlossanlop
Copy link

@carlossanlop carlossanlop added area-System.IO * NO MERGE * The PR is not ready for merge yet (see discussion for detailed reasons) NO REVIEW Experimental/testing PR, do NOT review it labels Oct 16, 2019
@carlossanlop carlossanlop self-assigned this Oct 16, 2019
@carlossanlop carlossanlop changed the title Add file and directory creation methods that take an ACL Add directory creation method that takes an ACL Oct 17, 2019
@carlossanlop
Copy link
Author

Due to the size of this change, his PR will only include the changes for the Directory Create method. I'll submit the File Create method in a new PR.

@carlossanlop carlossanlop removed the NO REVIEW Experimental/testing PR, do NOT review it label Oct 17, 2019
@carlossanlop carlossanlop merged commit 5ed2e98 into dotnet:master Oct 23, 2019
@carlossanlop carlossanlop deleted the FileSystemAclExtensions_Create branch October 23, 2019 14:20
carlossanlop added a commit that referenced this pull request Oct 29, 2019
Approved API Proposal: #41614
Related change for directory creation method that takes an ACL: #41834 -merged and ported to 3.1 Prev2

Description
We have extension methods in System.IO.FileSystem.AclExtensions that let the user get and set ACLs for existing files, but we do not have methods that create files with predefined ACLs.
.NET ACL (Access Control List) support is Windows specific. This change will reside inside the System.IO.FileSystem.AccessControl assembly.

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

Potential security hole as files can be accessed between creation and modification.
Porting difficulties as there isn't a 1-1 API replacement
Stability issues with background processes (file filters) can prevent modifying ACLs right after creation (typically surfaces as a security exception).
This change addresses those problems by adding a new extension method that allows creating a file and ensuring the provided ACLs are set during creation.
This change is expected to be backported to 3.1.
@karelz karelz modified the milestones: 3.1, 5.0 Dec 19, 2019
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* First commit

* Fix OperationCanceledException dependency error, revert nullable indication

* Only Directory files

* Unit tests verifications

* Split FileSystem.Windows into two additional files instead of one. Fix pinning.

* Remove dead comment, add actual UT verifications

* User WellKnownSidType

* Make method unsafe, nit comments addressed.

* Remove irrelevant comment

* Add additional exceptions to triple slash

* Add unit tests for additional exceptions

* Remove FileSystem.cs, it has one obsolete method. Replace all calls of that removed method.

* Second pass on required strings.resx resources

* Remove unused dependency cs files

* Move shared files to Common

* Add the missing braces

* Add nulcheck for this argument, add exception, document exception in triple slash, add unit test.

* Fix netstandard CI build failure

* Fix Microsoft.IO.Redist build issue with NetStandard

* Remove unnecessary assert in ut

* Fix build problem in Windows Packaging All Configurations x64_Debug, System.Runtime needs to be included to recognize NotNullIfNotNullAttribute, consumed in Path.Internal.cs

* Additional file splitting and dependency addition to fix netstandard/netfx build problems

* Fix netstandard and netcoreapp build issues

* Remove unused file

* nit cleaning

* Minimal unit tests

* Remove unused unit test code and spacing fix

* Add full framework condition to unit test

* Additional fix for full framework


Commit migrated from dotnet/corefx@5ed2e98
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Approved API Proposal: dotnet/corefx#41614
Related change for directory creation method that takes an ACL: dotnet/corefx#41834 -merged and ported to 3.1 Prev2

Description
We have extension methods in System.IO.FileSystem.AclExtensions that let the user get and set ACLs for existing files, but we do not have methods that create files with predefined ACLs.
.NET ACL (Access Control List) support is Windows specific. This change will reside inside the System.IO.FileSystem.AccessControl assembly.

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

Potential security hole as files can be accessed between creation and modification.
Porting difficulties as there isn't a 1-1 API replacement
Stability issues with background processes (file filters) can prevent modifying ACLs right after creation (typically surfaces as a security exception).
This change addresses those problems by adding a new extension method that allows creating a file and ensuring the provided ACLs are set during creation.
This change is expected to be backported to 3.1.

Commit migrated from dotnet/corefx@508cbc4
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants