From 6abca8ce5794013e2df449abc7d189bdbb0148e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 10 Jan 2014 03:29:37 +0100 Subject: [PATCH] backups: do not chdir() in main process This can be any application, for example Qubes Manager. Changing current dir can have side effects, especially when we do not change it back after restore (or in any error encountered). --- core/backup.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/core/backup.py b/core/backup.py index a55a7ae3..f6cc64a1 100644 --- a/core/backup.py +++ b/core/backup.py @@ -984,11 +984,6 @@ def backup_restore_header(source, passphrase, if format_version == 1: return (restore_tmpdir, os.path.join(source, 'qubes.xml')) - os.chdir(restore_tmpdir) - - if BACKUP_DEBUG: - print "Working in", restore_tmpdir - # tar2qfile matches only beginnings, while tar full path if appvm: extract_filter = ['qubes.xml.000'] @@ -1008,7 +1003,7 @@ def backup_restore_header(source, passphrase, compressed=compressed, appvm=appvm) - return (restore_tmpdir, "qubes.xml") + return (restore_tmpdir, os.path.join(restore_tmpdir, "qubes.xml")) def backup_restore_prepare(backup_location, qubes_xml, passphrase, options = {}, host_collection = None, encrypt=False, appvm=None, format_version=None):