Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/7.0-preview6] UnixFileMode backport #71199

Merged

Conversation

adamsitnik
Copy link
Member

@adamsitnik adamsitnik commented Jun 23, 2022

This is a backport of #69980 and #71188 to release/7.0-preview6

/cc @eerhardt @carlossanlop @tmds

Customer Impact

This is a brand-new feature that is going to allow our customers for getting/setting Unix file permissions and special bits. Including this feature in 7.0-preview6 will allow us to get customer feedback earlier on these new APIs.

Testing

If the CI is green, it means that the tests are passing.

Risk

Low - the changes are essentially scoped to the new API.

tmds and others added 2 commits June 23, 2022 13:10
* Implement UnixFileMode APIs on Unix.

* Throw PNSE on Windows, add UnsupportedOSPlatform.

* Fix API compat issue.

* Borrow a few things from SafeFileHandle API PR to this compiles.

* Fix System.IO.FileSystem.AccessControl compilation.

* Add xml docs.

* Replace Interop.Sys.Permissions to System.IO.UnixFileMode.

* Throw PNSE immediately on Windows.

* Add ODE to xml docs of methods that accept a handle.

* Don't throw (PNSE) from FileSystemInfo.UnixFileMode getter on Windows.

* Minor style fix.

* Get rid of some casts.

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>

* Add tests for creating a file/directory with UnixFileMode.

* Some CI envs don't have a umask exe, try retrieving via a shell builtin.

* Update expected test mode values.

* Fix OSX

* Fix Windows build.

* Add ArgumentException tests.

* Fix Windows build.

* Add get/set tests.

* Update test for Windows.

* Make setters target link instead of link target.

* Linux: fix SetUnixFileMode

* Fix OSX compilation.

* Try make all tests pass in CI.

* For link, operate on target permissions.

* Skip tests on Browser.

* Add tests for 'Get' that doesn't use a 'Set' first.

* Don't perform exist check for handles.

* Fix Get test for wasm.

* Review xml comments.

* Add comment to test.

* GetUnixFileMode for handle won't throw UnauthorizedAccessException.

* Apply suggestions from code review

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>

* PR feedback.

* Update enum doc to say 'owner' instead of 'user'.

* Use UnixFileMode in library.

* Use UnixFileMode in library tests.

* Fix Windows build.

* Fix missing FileAccess when changing to FileStreamOptions API.

* PR feedback.

* Fix Argument_InvalidUnixCreateMode message.

Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
@dotnet-issue-labeler
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost
Copy link

ghost commented Jun 23, 2022

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details

This is a backport of #69980 and #71188

As soon as the build gets green I am going to fill the template and send the email

Author: adamsitnik
Assignees: -
Labels:

area-System.IO

Milestone: -

@carlossanlop carlossanlop added Servicing-consider Issue for next servicing release review ask-mode labels Jun 23, 2022
@leecow leecow added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jun 23, 2022
@carlossanlop carlossanlop merged commit 57388eb into dotnet:release/7.0-preview6 Jun 23, 2022
@carlossanlop carlossanlop deleted the unixFileModeBackport branch June 23, 2022 17:33
@ghost ghost locked as resolved and limited conversation to collaborators Jul 23, 2022
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.

4 participants