Harden permissions for pipe used in SharedServer.#127239
Merged
cincuranet merged 1 commit intodotnet:mainfrom Apr 23, 2026
Merged
Harden permissions for pipe used in SharedServer.#127239cincuranet merged 1 commit intodotnet:mainfrom
cincuranet merged 1 commit intodotnet:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens Unix named-pipe (Unix domain socket) filesystem permissions when PipeOptions.CurrentUserOnly is used, by explicitly setting the socket file’s mode to user-only (0600). This aligns the on-disk endpoint permissions with the “current user only” intent and adds a regression test.
Changes:
- Set the Unix domain socket file mode to
UserRead | UserWritewhen creating aSharedServerforCurrentUserOnly. - Add a Unix test validating the socket file mode when
CurrentUserOnlyis specified. - Minor refactors to use
PipeOptions.HasFlag(...)in a few places.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Unix.cs |
Applies 0600 permissions to the bound socket path for CurrentUserOnly; adds cleanup on failure; refactors option checks. |
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CurrentUserOnly.Unix.cs |
Adds a regression test asserting the created socket path has user-only permissions. |
1f74be6 to
b3393d9
Compare
This was referenced Apr 22, 2026
Open
b3393d9 to
3c24218
Compare
Contributor
Author
|
/ba-g Failures are unrelated. |
Contributor
|
Added When you commit this breaking change:
Tagging @dotnet/compat for awareness of the breaking change. |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.