Confine package ownership changes to private mounts
This commit is contained in:
parent
2c420012bd
commit
8334fd379f
1 changed files with 402 additions and 25 deletions
|
|
@ -275,8 +275,23 @@ impl IgnoredWorkspace {
|
|||
let stat = match backing {
|
||||
Classification::Host => host,
|
||||
Classification::Isolated => isolated,
|
||||
}
|
||||
.ok_or_else(|| io::Error::from_raw_os_error(libc::ENOENT))?;
|
||||
};
|
||||
let (backing, stat) = if let Some(stat) = stat {
|
||||
(backing, stat)
|
||||
} else if backing == Classification::Isolated
|
||||
&& host.as_ref().is_some_and(|stat| {
|
||||
stat.st_mode & libc::S_IFMT == libc::S_IFDIR
|
||||
&& self
|
||||
.provenance
|
||||
.lock()
|
||||
.unwrap_or_else(std::sync::PoisonError::into_inner)
|
||||
.matches(path, &crate::migration::ObjectStamp::from_stat(stat))
|
||||
})
|
||||
{
|
||||
(Classification::Host, host.expect("checked host directory"))
|
||||
} else {
|
||||
return Err(io::Error::from_raw_os_error(libc::ENOENT));
|
||||
};
|
||||
Ok(ResolvedEntry {
|
||||
path: path.to_path_buf(),
|
||||
backing,
|
||||
|
|
|
|||
Loading…
Reference in a new issue