New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restoring a backup created with "--compress-filter 'gzip -3'" fails #3865

Open
keepiru opened this Issue Apr 28, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@keepiru

keepiru commented Apr 28, 2018

Qubes OS version:

Backup created on R3.2, attempted restore on R4.0

Affected component(s):

qvm-backup-restore

Steps to reproduce the behavior:

On R3.2:
qvm-backup -z -Z 'gzip -3' -d sys-usb /media/user/backups

On R4.0:
qvm-backup-restore -d sys-usb /run/media/user/backups/qubes-backup-2018-04-20T010203 my-vm

Expected behavior:

Backup is restored without errors.

Actual behavior:

app: Checking backup content...
qvm-backup-restore: error: Invalid backup header (value)

General notes:

I was able to work around the issue with this patch:

diff -r -u site-packages-orig/qubesadmin/backup/restore.py site-packages/qubesadmin/backup/restore.py
--- site-packages-orig/qubesadmin/backup/restore.py	2018-03-03 19:33:29.000000000 -0800
+++ site-packages/qubesadmin/backup/restore.py	2018-04-27 23:37:00.206134065 -0700
@@ -143,9 +143,6 @@
             if key not in self.header_keys.keys():
                 # Ignoring unknown option
                 continue
-            if not _re_alphanum.match(value):
-                raise QubesException("Invalid backup header ("
-                                                 "value)")
             if getattr(self, self.header_keys[key]) is not None:
                 raise QubesException(
                     "Duplicated header line: {}".format(key))
@@ -153,6 +150,8 @@
                 value = value.lower() in ["1", "true", "yes"]
             elif key in self.int_options:
                 value = int(value)
+            if value == 'gzip -3':
+                value = 'gzip'
             setattr(self, self.header_keys[key], value)
 
         self.validate()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment