[gparted] Display LUKS copy capability (#774818)



commit e31fa783a8d98d3e0b49b87f4bcc39d3d199183a
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Wed Dec 7 16:26:11 2016 +0000

    Display LUKS copy capability (#774818)
    
    Users will expect to see that copying of LUKS is available in the File
    System Support dialog, even if technically what is implemented is
    copying of the file system within an open encryption mapping.  There is
    no other reason to do this change as these two previous commits have
    fully enabled copying of encrypted content:
        Implement copy operation of encrypted file systems (#774814)
        Preview copy operation of encrypted file systems (#774818)
    
    Set LUKS .copy capability so that the dialog shows copying availability,
    but then disallow copying of closed LUKS.  (Checking for the capability
    and performing copying the content of an open LUKS encryption mapping is
    inherent in Win_GParted::set_valid_operations() and GParted_Core::copy()
    in the way that they access the block device containing the file system,
    whether encrypted or not).
    
    Bug 774818 - Implement LUKS read-write actions NOT requiring a
                 passphrase

 src/Win_GParted.cc |    7 +++++--
 src/luks.cc        |    5 +++++
 2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc
index 6ada585..33b1118 100644
--- a/src/Win_GParted.cc
+++ b/src/Win_GParted.cc
@@ -1242,8 +1242,11 @@ void Win_GParted::set_valid_operations()
                if ( (fs .grow || fs .shrink || fs .move ) && ! devices[ current_device ] .readonly ) 
                        allow_resize( true ) ;
                        
-               //only allow copying of real partitions
-               if ( selected_partition_ptr->status == STAT_REAL && fs_cap.copy )
+               // Only allow copying of real partitions, excluding closed encryption
+               // (which are only copied while open).
+               if ( selected_partition_ptr->status == STAT_REAL &&
+                    selected_filesystem.filesystem != FS_LUKS   &&
+                    fs_cap.copy                                    )
                        allow_copy( true ) ;
                
                //only allow labelling of real partitions that support labelling
diff --git a/src/luks.cc b/src/luks.cc
index f9a1a1b..8047210 100644
--- a/src/luks.cc
+++ b/src/luks.cc
@@ -28,6 +28,11 @@ FS luks::get_filesystem_support()
 
        fs.busy = FS::EXTERNAL;
        fs.read = FS::EXTERNAL;
+
+       // Setting .copy is just for displaying in the File System Support dialog.
+       // (Copying of encrypted content is only performed while open).
+       fs.copy = FS::GPARTED;
+
        fs.online_read = FS::EXTERNAL;
 
        return fs;


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