backup: do not dereference symlinks in dom0 user home backup
Symlinks there should be preserved. Additionally broken symlink would cause the backup to fail. Fixes QubesOS/qubes-issues#1515
This commit is contained in:
parent
530a79417f
commit
ba3b908b73
@ -567,15 +567,16 @@ def backup_do(base_backup_dir, files_to_backup, passphrase,
|
|||||||
# be verified before untaring this.
|
# be verified before untaring this.
|
||||||
# Prefix the path in archive with filename["subdir"] to have it
|
# Prefix the path in archive with filename["subdir"] to have it
|
||||||
# verified during untar
|
# verified during untar
|
||||||
tar_cmdline = ["tar", "-Pc", '--sparse',
|
tar_cmdline = (["tar", "-Pc", '--sparse',
|
||||||
"-f", backup_pipe,
|
"-f", backup_pipe,
|
||||||
'-C', os.path.dirname(filename["path"]),
|
'-C', os.path.dirname(filename["path"])] +
|
||||||
'--dereference',
|
(['--dereference'] if filename["subdir"] != "dom0-home/"
|
||||||
'--xform', 's:^%s:%s\\0:' % (
|
else []) +
|
||||||
|
['--xform', 's:^%s:%s\\0:' % (
|
||||||
os.path.basename(filename["path"]),
|
os.path.basename(filename["path"]),
|
||||||
filename["subdir"]),
|
filename["subdir"]),
|
||||||
os.path.basename(filename["path"])
|
os.path.basename(filename["path"])
|
||||||
]
|
])
|
||||||
if compressed:
|
if compressed:
|
||||||
tar_cmdline.insert(-1,
|
tar_cmdline.insert(-1,
|
||||||
"--use-compress-program=%s" % compression_filter)
|
"--use-compress-program=%s" % compression_filter)
|
||||||
|
Loading…
Reference in New Issue
Block a user