[PATCH] Remove encryption from preexisting device if "Encrypt" is deactivated.

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

 



...but only they are reformatting the device.
---
 iw/partition_dialog_gui.py |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/iw/partition_dialog_gui.py b/iw/partition_dialog_gui.py
index 29a7ebb..9499ea7 100644
--- a/iw/partition_dialog_gui.py
+++ b/iw/partition_dialog_gui.py
@@ -212,7 +212,7 @@ class PartitionEditor:
                     actions.append(ActionCreateDevice(luksdev))
                     actions.append(ActionCreateFormat(luksdev))
             else:
-                # preexisting partition, just set mount point and format flag
+                # preexisting partition
                 request = self.origrequest
                 if request.format.type == "luks":
                     usedev = self.storage.devicetree.getChildren(request)[0]
@@ -244,6 +244,26 @@ class PartitionEditor:
                             format = getFormat("luks",
                                                device=self.origrequest.path,
                                                passphrase=self.storage.encryptionPassphrase)
+                        elif self.fsoptionsDict.has_key("lukscb") and \
+                             not self.fsoptionsDict["lukscb"].get_active() and \
+                             request.format.type == "luks":
+                            # user elected to format the device w/o encryption
+                            try:
+                                luksdev = self.storage.devicetree.getChildren(request)[0]
+                            except IndexError:
+                                pass
+                            else:
+                                actions.append(ActionDestroyFormat(luksdev))
+                                actions.append(ActionDestroyDevice(luksdev))
+                                luksdev = None
+
+                            actions.append(ActionDestroyFormat(request))
+                            # we set the new format's device while under the
+                            # impression that the device was going to be
+                            # encrypted, so we need to remedy that now
+                            format.device = request.path
+                            usedev = request
+
                         actions.append(ActionCreateFormat(usedev, format))
                         if luksdev:
                             actions.append(ActionCreateDevice(luksdev))
-- 
1.6.0.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux