From 24ae2bf079d3c27f0f09b59e25e81970d21ff706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Wed, 11 May 2016 19:36:06 +0100 Subject: [PATCH] Do not allow restoring to the partition containing open luks volume. --- src/ops/restoreoperation.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ops/restoreoperation.cpp b/src/ops/restoreoperation.cpp index 37a1de3..682da99 100644 --- a/src/ops/restoreoperation.cpp +++ b/src/ops/restoreoperation.cpp @@ -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.