]> git.proxmox.com Git - pve-container.git/commitdiff
fixup comment about early lxc.idmap recovery
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 27 Dec 2018 12:55:46 +0000 (13:55 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 27 Dec 2018 13:20:38 +0000 (14:20 +0100)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/PVE/API2/LXC.pm

index b1704280d9b4136f2c6120ed3f9752ac6e67fe9b..70b190682d85fa2d6d1446f9b705d8da5b6f57fa 100644 (file)
@@ -362,7 +362,11 @@ __PACKAGE__->register_method({
            eval {
                my ($orig_conf, $orig_mp_param) = PVE::LXC::Create::recover_config($archive);
                if ($is_root) {
-                   $conf->{lxc} = [grep { $_->[0] eq 'lxc.idmap' } @{$orig_conf->{lxc}}]; # do not remove lxc.idmap entries
+                   # When we're root call 'restore_configuration' with ristricted=0,
+                   # causing it to restore the raw lxc entries, among which there may be
+                   # 'lxc.idmap' entries. We need to make sure that the extracted contents
+                   # of the container match up with the restored configuration afterwards:
+                   $conf->{lxc} = [grep { $_->[0] eq 'lxc.idmap' } @{$orig_conf->{lxc}}];
                }
                if ($storage_only_mode) {
                    if ($restore) {