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



commit 8984ccaf23917756f8f689a7517e99684da4ac43
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Sat Dec 3 20:05:24 2016 +0000

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

 src/GParted_Core.cc |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc
index f446df6..1f38bf5 100644
--- a/src/GParted_Core.cc
+++ b/src/GParted_Core.cc
@@ -2205,6 +2205,14 @@ bool GParted_Core::name_partition( const Partition & partition, OperationDetail
 
 bool GParted_Core::change_filesystem_uuid( const Partition & partition, OperationDetail & operationdetail )
 {
+       if ( partition.filesystem == FS_LUKS && partition.busy )
+       {
+               operationdetail.add_child( OperationDetail(
+                       GPARTED_BUG + ": " + _("partition contains open LUKS encryption for a change file 
system UUID only step"),
+                       STATUS_ERROR, FONT_ITALIC ) );
+               return false;
+       }
+
        if ( partition .uuid == UUID_RANDOM_NTFS_HALF ) {
                operationdetail .add_child( OperationDetail( String::ucompose(
                                                                                _("Set half of the UUID on %1 
to a new, random value"),


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