quarantine() handles the cross-filesystem case:
if std::fs::rename(file, &dest).is_err() {
std::fs::copy(file, &dest)...;
std::fs::remove_file(file)...;
}
restore() does not — it's fs::rename and nothing else.
So the exact case the move handles is the case the undo fails on. The app puts quarantine in the app-local-data dir, so any file scanned from another mount (a second drive, /home on its own partition) hits this: quarantining works, restoring returns EXDEV.
Fix is to pull the rename-then-copy-fallback out into a shared helper and use it in both directions.
crates/diskern-core/src/actions.rs:60
quarantine()handles the cross-filesystem case:restore()does not — it'sfs::renameand nothing else.So the exact case the move handles is the case the undo fails on. The app puts quarantine in the app-local-data dir, so any file scanned from another mount (a second drive,
/homeon its own partition) hits this: quarantining works, restoring returnsEXDEV.Fix is to pull the rename-then-copy-fallback out into a shared helper and use it in both directions.
crates/diskern-core/src/actions.rs:60