]> git.proxmox.com Git - qemu-server.git/commitdiff
fix #2367: do not allow snapshot with name PENDING
authorOguz Bektas <o.bektas@proxmox.com>
Thu, 24 Oct 2019 11:53:09 +0000 (13:53 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 25 Nov 2019 09:01:41 +0000 (10:01 +0100)
or any other variant of the word 'pending'.

note that we can actually allow this snapshot after PVE 7.0, since
pending section and snapshots will be properly namespaced.
([pve:pending] and [snap:$snapname] or similar).

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
PVE/QemuServer.pm

index 8c40ea211ea40cbb42e5d33b55f67a16dcb39a78..79001d78e09f61759a62a45f9fb6d5522cd2e724 100644 (file)
@@ -2740,7 +2740,10 @@ sub write_vm_config {
     &$cleanup_config($conf->{pending}, 1);
 
     foreach my $snapname (keys %{$conf->{snapshots}}) {
-       die "internal error" if $snapname eq 'pending';
+       # TODO: we can allow snapshots with name 'pending' after PVE 7.0
+       # since pending section is namespaced with 'pve:'
+       # but for now, we should forbid it to avoid confusion in parser
+       die "internal error: snapshot name '$snapname' is forbidden" if lc($snapname) eq 'pending';
        &$cleanup_config($conf->{snapshots}->{$snapname}, undef, $snapname);
     }