Watch
0
0
Fork
You've already forked hyperhive
0

run opted-in agents in a user namespace with a dedicated data owner

This commit is contained in:
atlas 2026-11-01 13:50:53 +01:00 • committed by mara
commit bfdf603d12

View file

@ -512,7 +512,7 @@ fn carry_nix_state(
/// owned by `uid:gid`), or `None` when `base` or an existing component is not a
/// real directory. The container could have replaced any of them by a link, and
/// this runs as root.
fn own_dir(base: &Path, parts: &[&str], uid: u32, gid: u32) -> Result<Option<PathBuf>> {
pub(crate) fn own_dir(base: &Path, parts: &[&str], uid: u32, gid: u32) -> Result<Option<PathBuf>> {
let mut path = base.to_path_buf();
if !std::fs::symlink_metadata(&path).is_ok_and(|m| m.is_dir()) {
return Ok(None);
@ -711,7 +711,7 @@ fn is_regular(path: &Path) -> bool {
/// `systemctl is-active` answers `inactive` or `failed` for a unit that is not
/// running; anything else (`active`, `activating`, `deactivating`) means the
/// root is, or is about to be, in use.
fn unit_is_stopped(container: &str) -> Result<bool> {
pub(crate) fn unit_is_stopped(container: &str) -> Result<bool> {
let out = std::process::Command::new("systemctl")
.args(["is-active", &format!("container@{container}.service")])
.output()