Skip to content

How to specify PipeSecurity when using ListenNamedPipe #56443

Answered by samsosa
CyrilPaulus asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, that doesn't work. I can't remember exactly why, but the WorldSid doesn't help.

The following works fine for me with NamedPipes, you can try it out:

var ps = new PipeSecurity();
// ps.AddAccessRule(new PipeAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null), PipeAccessRights.ReadWrite | PipeAccessRights.CreateNewInstance, AccessControlType.Allow));
try { ps.AddAccessRule(new PipeAccessRule(new SecurityIdentifier(WellKnownSidType.NetworkSid, null), PipeAccessRights.ReadWrite | PipeAccessRights.CreateNewInstance, AccessControlType.Allow)); } catch { }
try { ps.AddAccessRule(new PipeAccessRule(new SecurityIdentifier(WellKnownSidType.InteractiveSid, null), PipeAccessRights.R…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@CyrilPaulus
Comment options

@samsosa
Comment options

Answer selected by CyrilPaulus
@CyrilPaulus
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants