[lxc-devel] [lxd/master] containers: fix snapshot deletion

brauner on Github lxc-bot at linuxcontainers.org
Mon Apr 9 16:44:40 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 381 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180409/2e1a51f8/attachment.bin>
-------------- next part --------------
From 9af61b207f3ec4ab8ec66e32a471eaa605bea7a4 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Mon, 9 Apr 2018 18:43:52 +0200
Subject: [PATCH] containers: fix snapshot deletion

Closes #4431.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 lxd/container_snapshot.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lxd/container_snapshot.go b/lxd/container_snapshot.go
index bed3233a52..fc39d03b82 100644
--- a/lxd/container_snapshot.go
+++ b/lxd/container_snapshot.go
@@ -6,6 +6,7 @@ import (
 	"fmt"
 	"io/ioutil"
 	"net/http"
+	"net/url"
 	"strings"
 
 	"github.com/gorilla/mux"
@@ -161,6 +162,10 @@ func snapshotHandler(d *Daemon, r *http.Request) Response {
 		return response
 	}
 
+	snapshotName, err = url.QueryUnescape(snapshotName)
+	if err != nil {
+		return SmartError(err)
+	}
 	sc, err := containerLoadByName(
 		d.State(),
 		containerName+


More information about the lxc-devel mailing list