[lxc-devel] [lxd/master] container_backup: Fixes crash when renaming non-existent backup

tomponline on Github lxc-bot at linuxcontainers.org
Thu May 16 11:10:38 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 376 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190516/bff621b9/attachment.bin>
-------------- next part --------------
From 503235a98c85ae8080331d56f094b6f8c6e52a4a Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parrott at canonical.com>
Date: Thu, 16 May 2019 12:08:37 +0100
Subject: [PATCH] container_backup: Fixes crash when renaming non-existent
 backup

Fixes #5762

Signed-off-by: Thomas Parrott <thomas.parrott at canonical.com>
---
 lxd/container_backup.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/container_backup.go b/lxd/container_backup.go
index e50b4d2792..6425becae8 100644
--- a/lxd/container_backup.go
+++ b/lxd/container_backup.go
@@ -226,7 +226,7 @@ func containerBackupPost(d *Daemon, r *http.Request) Response {
 	oldName := name + shared.SnapshotDelimiter + backupName
 	backup, err := backupLoadByName(d.State(), project, oldName)
 	if err != nil {
-		SmartError(err)
+		return SmartError(err)
 	}
 
 	newName := name + shared.SnapshotDelimiter + req.Name


More information about the lxc-devel mailing list