From 4d22ee4852ba9b300489d332c210b920d01db8d9 Mon Sep 17 00:00:00 2001 From: Dexter Reed Date: Sun, 25 Aug 2024 14:22:09 +0100 Subject: [PATCH] Fix trashing files on Fedora Atomic variants --- src/freedesktop.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/freedesktop.rs b/src/freedesktop.rs index b8f85fb..3283231 100644 --- a/src/freedesktop.rs +++ b/src/freedesktop.rs @@ -48,6 +48,9 @@ impl TrashContext { // Note that the following function creates the trash folder // and its required subfolders in case they don't exist. move_to_trash(path, &home_trash, topdir).map_err(|(p, e)| fs_error(p, e))?; + } else if topdir.to_str() == Some("/var/home") && home_topdir.to_str() == Some("/") { + debug!("The topdir is '/var/home' but the home_topdir is '/', moving to the home trash anyway."); + move_to_trash(path, &home_trash, topdir).map_err(|(p, e)| fs_error(p, e))?; } else { execute_on_mounted_trash_folders(uid, topdir, true, true, |trash_path| { move_to_trash(&path, trash_path, topdir)