Merge lp:~gothicx/apport/hide_disk_labels into lp:~apport-hackers/apport/trunk

Proposed by Marco Rodrigues
Status: Merged
Merged at revision: not available
Proposed branch: lp:~gothicx/apport/hide_disk_labels
Merge into: lp:~apport-hackers/apport/trunk
Diff against target: None lines
To merge this branch: bzr merge lp:~gothicx/apport/hide_disk_labels
Reviewer Review Type Date Requested Status
Martin Pitt (community) Needs Fixing
Review via email: mp+11392@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

Marco Rodrigues [2009-09-08 20:30 -0000]:
> - report['UdevDb'] = command_output(['udevadm', 'info', '--export-db'])
> -
> + report['UdevDb'] = command_output(['sh', '-c', 'udevadm info --export-db | grep -vi label'])
> +

I don't particularly like the overhead of calling a subshell, but it's
okay (I guess it won't be much faster to filter in Python).

However, grepping for "label" is both wrong and filters too much. It
will filter out the all the /dev/disks/by-label/... lines completely.
Instead, you want to obfuscate them to say e. g.

  /dev/disks/by-label/<hidden>

and you need to obfuscate out these:

E: ID_FS_LABEL=test
E: ID_FS_LABEL_ENC=test

Please don't filter out anything, since that would make it impossible
to see whether udev in fact did detect the label correctly. Please
just rewrite it as

E: ID_FS_LABEL=<hidden>

Revision history for this message
Martin Pitt (pitti) :
review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'apport/hookutils.py'
2--- apport/hookutils.py 2009-09-03 14:21:12 +0000
3+++ apport/hookutils.py 2009-09-08 20:27:57 +0000
4@@ -94,8 +94,8 @@
5
6 report['Lspci'] = command_output(['lspci','-vvnn'])
7 report['Lsusb'] = command_output(['lsusb'])
8- report['UdevDb'] = command_output(['udevadm', 'info', '--export-db'])
9-
10+ report['UdevDb'] = command_output(['sh', '-c', 'udevadm info --export-db | grep -vi label'])
11+
12 dmi_dir = '/sys/class/dmi/id'
13 if os.path.isdir(dmi_dir):
14 for f in os.listdir(dmi_dir):

Subscribers

People subscribed via source and target branches