The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/6344
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === … volume Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
From 316e1f0847b2ca3b7dd5774f5cd3929db39cd449 Mon Sep 17 00:00:00 2001 From: Thomas Parrott <thomas.parr...@canonical.com> Date: Wed, 23 Oct 2019 14:55:41 +0100 Subject: [PATCH] lxc/storage/volume: Adds volume snapshot rename check for same parent volume Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com> --- lxc/storage_volume.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lxc/storage_volume.go b/lxc/storage_volume.go index 9bdc70de5e..33e5d85d31 100644 --- a/lxc/storage_volume.go +++ b/lxc/storage_volume.go @@ -1214,7 +1214,11 @@ func (c *cmdStorageVolumeRename) Run(cmd *cobra.Command, args []string) error { if isSnapshot { // Create the storage volume entry vol := api.StorageVolumeSnapshotPost{} - _, dstSnapName, dstIsSnap := shared.ContainerGetParentAndSnapshotName(args[2]) + dstParentName, dstSnapName, dstIsSnap := shared.ContainerGetParentAndSnapshotName(args[2]) + + if dstParentName != fields[0] { + return fmt.Errorf("Invalid new snapshot name, parent volume must be the same as source") + } if !dstIsSnap { return fmt.Errorf("Invalid new snapshot name")
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel