Treat /var/home/<user>/* as removable on Fedora Atomic

On Fedora Silverblue, Kinoite, Bazzite, etc., /home is a symlink to
/var/home, and accounts created after first-boot often have $HOME set
to /var/home/<user> directly. Game directories stored under that path
were misclassified as protected by is_removeable(), so the uninstall
dialog refused to delete them.

Extend the existing /var special case to fold /var/home/<user>/* into
the /home/<user>/* logic, preserving the same protections for the user
root and PROTECTED_HOME_FOLDERS entries. Fixes #6685.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Daniel Johnson
2026-05-12 19:59:38 -04:00
parent de576c6991
commit 28cafbb2fd

View File

@@ -476,10 +476,14 @@ def is_removeable(path: str, system_config: dict[str, str]) -> bool:
if parts[0] == "var":
# Fedora Silverblue puts mount points under /var since they are mutable
# so we'll special case /var/mnt/<drive>/*.
# so we'll special case /var/mnt/<drive>/* and /var/media/<drive>/*,
# and /var/home/<user>/* (since /home is a symlink to /var/home).
if len(parts) > 3 and parts[1] in ("mnt", "media"):
return True
return False
if len(parts) > 1 and parts[1] == "home":
parts = parts[1:]
else:
return False
if parts[0] in ("usr", "lib", "etc", "boot", "sbin", "bin"):
# Path is part of the system folders