[pve-devel] [PATCH stable-4 guest-common] Fix #1480: die if snapshot name is not found before set_lock is used

Fabian Grünbichler f.gruenbichler at proxmox.com
Fri Sep 1 09:41:02 CEST 2017


I am not sure we need to cherry-pick this, it's a minor inconvenience,
but not a serious bug..

On Mon, Aug 28, 2017 at 11:23:39AM +0200, Alwin Antreich wrote:
> Signed-off-by: Alwin Antreich <a.antreich at proxmox.com>
> ---
>  PVE/AbstractConfig.pm | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/PVE/AbstractConfig.pm b/PVE/AbstractConfig.pm
> index 482f0e2..9495798 100644
> --- a/PVE/AbstractConfig.pm
> +++ b/PVE/AbstractConfig.pm
> @@ -467,9 +467,13 @@ sub snapshot_delete {
> 
>      my $prepare = 1;
> 
> -    my $snap;
>      my $unused = [];
> 
> +    my $conf = $class->load_config($vmid);
> +    my $snap = $conf->{snapshots}->{$snapname};
> +
> +    die "snapshot '$snapname' does not exist\n" if !defined($snap);
> +
>      $class->set_lock($vmid, 'snapshot-delete')
>  	if (!$drivehash); # doesn't already have a 'snapshot' lock
> 
> --
> 2.11.0
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel




More information about the pve-devel mailing list