Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion python/src/sandlock/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
)
from .inputs import inputs
from .handler import Handler, NotifAction, HandlerCtx, ExceptionPolicy
from .sandbox import Sandbox, BranchAction, parse_ports, Change, DryRunResult
from .sandbox import (
Sandbox, BranchAction, parse_ports, Change, DryRunResult, StdioMode, Process,
)
from ._profile import load_profile, list_profiles
from .exceptions import (
SandlockError,
Expand Down Expand Up @@ -49,6 +51,8 @@
"parse_ports",
"Change",
"DryRunResult",
"StdioMode",
"Process",
"Protection",
# Handler ABI
"Handler",
Expand Down
16 changes: 16 additions & 0 deletions python/src/sandlock/_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,22 @@ def confine(policy: "PolicyDataclass") -> None:
_lib.sandlock_handle_port_mappings.restype = ctypes.c_char_p
_lib.sandlock_handle_port_mappings.argtypes = [_c_handle_p]

# Streaming-stdio popen (RFC #67): create+start a live handle with per-stream
# StdioMode; each piped stream's owned fd is returned through its out pointer.
_lib.sandlock_popen.restype = _c_handle_p
_lib.sandlock_popen.argtypes = [
_c_policy_p,
ctypes.c_char_p,
ctypes.POINTER(ctypes.c_char_p),
ctypes.c_uint,
ctypes.c_uint32, # stdin_mode
ctypes.c_uint32, # stdout_mode
ctypes.c_uint32, # stderr_mode
ctypes.POINTER(ctypes.c_int), # out_stdin_fd
ctypes.POINTER(ctypes.c_int), # out_stdout_fd
ctypes.POINTER(ctypes.c_int), # out_stderr_fd
]

# Result
_lib.sandlock_result_exit_code.restype = ctypes.c_int
_lib.sandlock_result_exit_code.argtypes = [_c_result_p]
Expand Down
Loading
Loading