From 5cfbed3f38fb65e5e50d77e417e289137bb82198 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 20 Oct 2025 11:07:43 -0400 Subject: [PATCH] ostree-ext: Stub out config loading if we detect nspawn Workaround for https://github.com/rpm-software-management/mock/pull/1613#issuecomment-3421908652 Signed-off-by: Colin Walters --- crates/ostree-ext/src/globals.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/ostree-ext/src/globals.rs b/crates/ostree-ext/src/globals.rs index a60ce56d7..751499966 100644 --- a/crates/ostree-ext/src/globals.rs +++ b/crates/ostree-ext/src/globals.rs @@ -81,8 +81,14 @@ impl ConfigPaths { /// Return the path to the global container authentication file, if it exists. pub fn get_global_authfile(root: &Dir) -> Result> { - let root = &RootDir::new(root, ".")?; let am_uid0 = rustix::process::getuid() == rustix::process::Uid::ROOT; + // Workaround for https://github.com/rpm-software-management/mock/pull/1613#issuecomment-3421908652 + #[cfg(test)] + if !am_uid0 { + return Ok(None); + } + + let root = &RootDir::new(root, ".")?; get_global_authfile_impl(root, am_uid0) } @@ -115,6 +121,7 @@ mod tests { } #[test] + #[ignore = "https://github.com/rpm-software-management/mock/pull/1613#issuecomment-3421908652"] fn test_config_paths() -> Result<()> { let root = &cap_tempfile::TempDir::new(cap_std::ambient_authority())?; let rootdir = &RootDir::new(root, ".")?;