dom0/backup-restore: chown dom0 home after restore

It can happen that backup was done as different user (in terms of UID) than on
restore system. Correct this by chown.

Especially this is the case when backup was done on Qubes R1 and restore on
Qubes R2.
This commit is contained in:
Marek Marczykowski 2013-02-27 05:34:53 +01:00
parent d89bdac58c
commit 52dbedaac2

View File

@ -1364,5 +1364,8 @@ def backup_restore_do(backup_dir, restore_info, host_collection = None, print_ca
retcode = subprocess.call (["cp", "-nrp", backup_dom0_home_dir + '/' + f, home_file])
if retcode != 0:
error_callback("*** Error while copying file {0} to {1}".format(backup_dom0_home_dir + '/' + f, home_file))
retcode = subprocess.call(['sudo', 'chown', '-R', local_user, home_dir])
if retcode != 0:
error_callback("*** Error while setting home directory owner")
# vim:sw=4:et: