Documentation
¶
Overview ¶
Package ipc provides communication between parent and child processes that setup Drop sandbox. The communication is via a Unix domain socket.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewParentChildSocket ¶
NewParentChildSocket creates an anonymous socket that parent uses to send arguments to the child, which also signals to the child that parent has already setup networking.
Types ¶
type ChildArgs ¶
ChildArgs contains arguments needed by both parent and child that the parent constructs and sends to the child.
Note for future extensions: unexported fields or interface types if included within ChildArgs chierarchy will not be encoded and sent (encoding/gob limitation).
type ChildEnd ¶
type ChildEnd struct {
// Public, so parent process can pass it to the executed child as
// ExtraFiles
Socket *os.File
}
func NewChildEnd ¶
func (*ChildEnd) RecvChildArgs ¶
RecvChildArgs receives arguments sent by the parent process to the child. The function blocks until the arguments are available.
type ParentEnd ¶
type ParentEnd struct {
// contains filtered or unexported fields
}
func NewParentEnd ¶
func (*ParentEnd) SendChildArgs ¶
SendChildArgs serializes and sends to the child all the necessary arguments and configuration options obtained by the parent from command line and from config files.
Parent sends the arguments after all the necessary setup needed by the child is finished (network setup is done), so the child can assume that after the arguments are received, a sandboxed process can be launched.
type PtyReceiver ¶ added in v0.1.8
type PtyReceiver struct {
// contains filtered or unexported fields
}
PtyReceiver is created by the parent process to receive parent's descriptor of a sandboxed pseudoterminal. Parent process uses this descriptor to stream input and output between the sandboxed and the original terminal.
Unlike the parent-child socket pair, this uses a named Unix domain socket so it can also receive the descriptor from runsc, which connects to and sends the pseudoterminal master over a named socket passed via --console-socket and does not support an unnamed socket pair.
func NewPtyReceiver ¶ added in v0.1.8
func NewPtyReceiver(path string) (*PtyReceiver, error)
NewPtyReceiver creates a named Unix domain socket and listens on it.
It is OK for the sender (the child, or runsc via --console-socket) to connect to the socket and send the descriptor before the parent calls RecvPty.
func (*PtyReceiver) Close ¶ added in v0.1.8
func (p *PtyReceiver) Close()
Close closes the listening socket and removes it from the filesystem.
type PtySender ¶ added in v0.1.8
type PtySender struct {
// contains filtered or unexported fields
}
PtySender is created by the child process to send parent's descriptor of a sandboxed pseudoterminal.
func NewPtySender ¶ added in v0.1.8
NewPtySender connects to the named Unix domain socket the parent listens on (path).