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

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

Dave Lehman wrote:

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

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


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

         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
             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()

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



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