Re: [PATCH] don't dump private data members

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

 





Dave Lehman wrote:
Hi,

We currently can only do dump filtering based on a fully qualified
object reference (eg: anaconda.id.bootloader.password). This is somewhat
problematic w/ encrypted block device passphrases since they can live in
partRequest instances and therefore cannot be referenced as previously
described. Initially I set out to implement dump filtering based on
class name and member name, but I stumbled onto a much simpler solution:
just make passphrase member into __passphrase and then filter out and
private members (those with leading "__") from the dump.

This is intended to go into rawhide after F10, but a case could be made
to add it for both F10 and RHEL5.3 since it prevents passphrases from
appearing in anacdump.txt.

See attached patch.


diff --git a/exception.py b/exception.py
index e4e7c08..b146315 100644
--- a/exception.py
+++ b/exception.py
@@ -89,6 +89,9 @@ class AnacondaExceptionDump:
         pad = ' ' * ((level) * 2)

         for key, value in instance.__dict__.items():
+            if key.startswith("_%s__" % instance.__class__.__name__):
+                continue
+
             if parentkey != "":
                 curkey = parentkey + "." + key
             else:

This is beyond my python skills, so no comment on this.

<snip>

index baf8faf..35ba42c 100644
--- a/partitions.py
+++ b/partitions.py
@@ -104,7 +104,7 @@ def partitioningComplete(anaconda):
             continue

         if request.encryption and request.encryption.format:
-            if anaconda.isKickstart and request.encryption.passphrase:
+            if anaconda.isKickstart and request.encryption.hasPassphrase():
                 # they set a passphrase for this device explicitly
                 pass
             elif partitions.encryptionPassphrase:




@@ -369,6 +369,8 @@ class Partitions:
         """Clear the delete list and set self.requests to reflect disk."""
         self.deletes = []
         self.requests = []
+        if diskset.anaconda.isKickstart:
+            self.getEncryptedDevices(diskset)
         labels = diskset.getInfo()
         drives = diskset.disks.keys()
         drives.sort()


This last hunk does not seem to belong in this patch.

Regards,

Hans

_______________________________________________
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