From 10095e382a5cb3259d03ff27496619e3643b9e36 Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Sun, 27 Feb 2022 18:57:20 +0100 Subject: [PATCH] disk: fix Payload cloning bugs In LUKSContainer and LVMLogicalVolume we neglected to clone the Payload which means we would modify the base PartitionTable when manipulating the clone. --- internal/disk/luks.go | 2 +- internal/disk/lvm.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/disk/luks.go b/internal/disk/luks.go index 9dd311c43..93e9c1548 100644 --- a/internal/disk/luks.go +++ b/internal/disk/luks.go @@ -61,7 +61,7 @@ func (lc *LUKSContainer) Clone() Entity { Memory: lc.PBKDF.Memory, Parallelism: lc.PBKDF.Parallelism, }, - Payload: lc.Payload, + Payload: lc.Payload.Clone(), } } diff --git a/internal/disk/lvm.go b/internal/disk/lvm.go index 1e9c4223a..1e4b2db11 100644 --- a/internal/disk/lvm.go +++ b/internal/disk/lvm.go @@ -134,7 +134,7 @@ func (lv *LVMLogicalVolume) Clone() Entity { return &LVMLogicalVolume{ Name: lv.Name, Size: lv.Size, - Payload: lv.Payload, + Payload: lv.Payload.Clone(), } }