Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,14 @@ func makeServerPipeHandle(path string, sd []byte, c *PipeConfig, first bool) (wi
}
}

typ := uint32(windows.FILE_PIPE_REJECT_REMOTE_CLIENTS)
var typ uint32
switch {
case c.AcceptRemoteClients:
typ |= windows.FILE_PIPE_ACCEPT_REMOTE_CLIENTS
default:
typ |= windows.FILE_PIPE_REJECT_REMOTE_CLIENTS
}

if c.MessageMode {
typ |= windows.FILE_PIPE_MESSAGE_TYPE
}
Expand Down Expand Up @@ -498,6 +505,10 @@ type PipeConfig struct {
// when the pipe is in message mode.
MessageMode bool

// AcceptRemoteClients determines whether clients connecting from remote machines
// (for example over SMB) are permitted. When false, remote clients are rejected.
AcceptRemoteClients bool

// InputBufferSize specifies the size of the input buffer, in bytes.
InputBufferSize int32

Expand Down