_fs
_fs
¶
Sandbox-specific filesystem helpers.
Generic helpers (ensure_dir, ensure_dir_writable,
write_sensitive_file) live in terok_util.fs;
sandbox's _util/__init__.py re-exports them so the existing
from .._util import ensure_dir callsites keep working. Only
sandbox-specific helpers stay in this module.
systemd_user_unit_dir()
¶
Return the systemd user unit directory, validated against path traversal.
Refuses to run as root (euid == 0) and resolves $XDG_CONFIG_HOME
to ensure the result stays beneath the user's home directory.
Raises SystemExit on validation failure.