Skip to content

Commit b7e0cf1

Browse files
committed
Fix check for backing up dom0 to itself
During 301e66f, an essential test to check if target vm is indeed dom0 was not added. resolves: QubesOS/qubes-issues#10127
1 parent 43eac30 commit b7e0cf1

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

qubes/backup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,9 +455,10 @@ def get_files_to_backup(self):
455455
home_dir = pwd.getpwnam(local_user).pw_dir
456456

457457
# Checking if target is not user home directory in dom0
458-
if self.target_dir in ["", "~"] or Path(
459-
self.target_dir
460-
).is_relative_to(home_dir):
458+
if self.target_vm == self.app.domains[0] and (
459+
self.target_dir in ["", "~"]
460+
or Path(self.target_dir).is_relative_to(home_dir)
461+
):
461462
raise qubes.exc.QubesException(
462463
"Can not backup dom0 home directory to itself!"
463464
)

0 commit comments

Comments
 (0)