Do not allow restoring to the partition containing open luks volume.
This commit is contained in:
parent
513bbdac4c
commit
24ae2bf079
|
@ -30,6 +30,7 @@
|
|||
#include "jobs/resizefilesystemjob.h"
|
||||
|
||||
#include "fs/filesystem.h"
|
||||
#include "fs/luks.h"
|
||||
#include "fs/filesystemfactory.h"
|
||||
|
||||
#include "util/capacity.h"
|
||||
|
@ -198,6 +199,9 @@ bool RestoreOperation::canRestore(const Partition* p)
|
|||
if (p->roles().has(PartitionRole::Extended))
|
||||
return false;
|
||||
|
||||
if (p->roles().has(PartitionRole::Luks))
|
||||
return FS::luks::mapperName(p->deviceNode()).isEmpty();
|
||||
|
||||
return true;
|
||||
}
|
||||
/** Creates a new Partition to restore to.
|
||||
|
|
Loading…
Reference in New Issue