Skip to main content

Module control

Module control 

Source
Expand description

Typed connection-multiplexing configuration and wire primitives.

This module deliberately contains no CLI, dispatcher, or live SSH runtime integration. It is the policy and protocol boundary those layers use.

Structs§

AttachedSession
ControlData
Ordered session data or EOF indication.
ControlPathContext
Deterministic values used to expand an OpenSSH ControlPath template.
ControlPolicy
Typed view over the three string-valued fields currently stored in SshHostConfig.
ControlRequest
Correlated client-to-master request.
ControlResponse
Correlated master-to-client response.
ControlSocketGuard
RunningControlMaster
SessionOpenRequest
Session policy transferred to the authenticated control master.

Enums§

AttachOutcome
ControlCommand
Commands accepted by OpenSSH-compatible -O control handling.
ControlConfigError
Invalid user-authored control configuration.
ControlDataStream
Byte stream represented by a data message.
ControlMasterMode
OpenSSH ControlMaster connection-selection policy.
ControlMessage
One framed message on a bssh control socket.
ControlOperation
Request operation understood by a bssh control master.
ControlPathError
Invalid or unrepresentable ControlPath values.
ControlPersist
Lifetime policy for an idle multiplexing master.
ControlProtocolError
Framing, serialization, version, or semantic-limit failure.
ControlResponseKind
Result variants needed by #286’s session and five control commands.

Constants§

CONTROL_PROTOCOL_VERSION
Version of bssh’s length-prefixed JSON multiplexing protocol.
MAX_CONTROL_DATA_BYTES
Largest binary chunk carried in one data message.
MAX_CONTROL_FRAME_BYTES
Largest accepted serialized control message.

Functions§

attach_session
bind_control_socket
Bind with a private temporary pathname, chmod it before publication, and hard-link it into place. No client can reach the socket while its mode is broader than 0600.
connect_control_socket
expand_control_path
Expand the #286 ControlPath token subset and validate the resulting Unix socket address before any connection or bind attempt.
prepare_attached_session
Complete the hello and OpenSession exchange without starting local I/O. Callers implementing -f may safely detach after this returns because the master has authenticated the control peer and accepted the session.
read_control_message
Read, decode, and validate one bounded big-endian-length-prefixed JSON message without allocating an attacker-declared oversized frame.
remove_stale_control_socket
Remove a refused socket only when it is still the exact same socket owned by this uid. Regular files, symlinks, replacement sockets, and foreign sockets are never removed.
send_control_command
start_control_master
start_control_master_with_bootstrap_session
Start a master and optionally let its own initial foreground passenger attach without an ask prompt. Subsequent shared sessions still honor require_confirmation.
unix_socket_path_capacity
Number of bytes in sockaddr_un.sun_path, including its terminating NUL. Non-Unix targets return None and remain compile-safe without claiming Unix-domain socket support.
validate_control_socket_path
Validate an already-expanded control socket path.
verify_same_user
write_control_message
Serialize and write one bounded big-endian-length-prefixed JSON message.