]> git.proxmox.com Git - pve-container.git/commitdiff
don't allow automatic restore to dev/bind rootfs
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 30 May 2016 12:40:24 +0000 (14:40 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 1 Jun 2016 05:46:54 +0000 (07:46 +0200)
we cannot delay the rootfs, but we also don't want
to automatically restore to a device or bind mount
because that might destroy existing data..

only allow this when explicitly requested via -rootfs

src/PVE/API2/LXC.pm

index 1316fbf1e47095e19328b6c746295c27c7044731..7ed778b3af99160484f0ce55b7669568654d814d 100644 (file)
@@ -336,6 +336,9 @@ __PACKAGE__->register_method({
                                $mp_param->{$ms} = PVE::LXC::Config->print_ct_mountpoint($mountpoint, $ms eq 'rootfs');
                            } else {
                                my $type = $mountpoint->{type};
+                               die "restoring rootfs to $type mount is only possible by specifying -rootfs manually!\n"
+                                   if ($ms eq 'rootfs');
+
                                if ($mountpoint->{backup}) {
                                    warn "WARNING - unsupported configuration!\n";
                                    warn "backup was enabled for $type mountpoint $ms ('$mountpoint->{mp}')\n";