Skip to content

Commit 5cfbed3

Browse files
committed
ostree-ext: Stub out config loading if we detect nspawn
Workaround for rpm-software-management/mock#1613 (comment) Signed-off-by: Colin Walters <[email protected]>
1 parent 8abee04 commit 5cfbed3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

crates/ostree-ext/src/globals.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,14 @@ impl ConfigPaths {
8181

8282
/// Return the path to the global container authentication file, if it exists.
8383
pub fn get_global_authfile(root: &Dir) -> Result<Option<(Utf8PathBuf, File)>> {
84-
let root = &RootDir::new(root, ".")?;
8584
let am_uid0 = rustix::process::getuid() == rustix::process::Uid::ROOT;
85+
// Workaround for https://github.com/rpm-software-management/mock/pull/1613#issuecomment-3421908652
86+
#[cfg(test)]
87+
if !am_uid0 {
88+
return Ok(None);
89+
}
90+
91+
let root = &RootDir::new(root, ".")?;
8692
get_global_authfile_impl(root, am_uid0)
8793
}
8894

@@ -115,6 +121,7 @@ mod tests {
115121
}
116122

117123
#[test]
124+
#[ignore = "https://github.com/rpm-software-management/mock/pull/1613#issuecomment-3421908652"]
118125
fn test_config_paths() -> Result<()> {
119126
let root = &cap_tempfile::TempDir::new(cap_std::ambient_authority())?;
120127
let rootdir = &RootDir::new(root, ".")?;

0 commit comments

Comments
 (0)