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.
This commit is contained in:
Achilleas Koutsou 2022-02-27 18:57:20 +01:00 committed by Tom Gundersen
parent e921b7aadd
commit 10095e382a
2 changed files with 2 additions and 2 deletions

View file

@ -61,7 +61,7 @@ func (lc *LUKSContainer) Clone() Entity {
Memory: lc.PBKDF.Memory,
Parallelism: lc.PBKDF.Parallelism,
},
Payload: lc.Payload,
Payload: lc.Payload.Clone(),
}
}

View file

@ -134,7 +134,7 @@ func (lv *LVMLogicalVolume) Clone() Entity {
return &LVMLogicalVolume{
Name: lv.Name,
Size: lv.Size,
Payload: lv.Payload,
Payload: lv.Payload.Clone(),
}
}