[gparted] Add bug checks into copy operation methods (#774818)



commit 89540fedd84d91580284c166856bf8266b179053
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Sun Dec 4 10:47:18 2016 +0000

    Add bug checks into copy operation methods (#774818)
    
    Ensure pre-condition of never being passed a Partition object containing
    an open LUKS encryption mapping is met for copy operation related
    methods.
    
    Bug 774818 - Implement LUKS read-write actions NOT requiring a
                 passphrase

 src/GParted_Core.cc |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc
index a152338..e29ed6b 100644
--- a/src/GParted_Core.cc
+++ b/src/GParted_Core.cc
@@ -3013,6 +3013,21 @@ bool GParted_Core::copy_filesystem( const Partition & partition_src,
                                     Partition & partition_dst,
                                     OperationDetail & operationdetail )
 {
+       if ( partition_src.filesystem == FS_LUKS && partition_src.busy )
+       {
+               operationdetail.add_child( OperationDetail(
+                       GPARTED_BUG + ": " + _("source partition contains open LUKS encryption for a file 
system copy only step"),
+                       STATUS_ERROR, FONT_ITALIC ) );
+               return false;
+       }
+       if ( partition_dst.filesystem == FS_LUKS && partition_dst.busy )
+       {
+               operationdetail.add_child( OperationDetail(
+                       GPARTED_BUG + ": " + _("destination partition contains open LUKS encryption for a 
file system copy only step"),
+                       STATUS_ERROR, FONT_ITALIC ) );
+               return false;
+       }
+
        operationdetail.add_child( OperationDetail(
                        String::ucompose( _("copy file system from %1 to %2"),
                                          partition_src.get_path(),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]