Merge lp:~mfisch/lightdm/lightdm-various-fixes into lp:~ubuntu-desktop/lightdm/ubuntu

Proposed by Matt Fischer on 2012-11-06
Status: Merged
Merged at revision: 1124
Proposed branch: lp:~mfisch/lightdm/lightdm-various-fixes
Merge into: lp:~ubuntu-desktop/lightdm/ubuntu
Diff against target: 93 lines (+32/-8)
4 files modified
debian/lightdm.install (+1/-1)
debian/lightdm.postinst (+1/-1)
debian/lightdm.postrm (+9/-0)
debian/source_lightdm.py (+21/-6)
To merge this branch: bzr merge lp:~mfisch/lightdm/lightdm-various-fixes
Reviewer Review Type Date Requested Status
Ubuntu Desktop 2012-11-06 Pending
Review via email: mp+133141@code.launchpad.net

Description of the change

This review fixes the case where someone does a remove+purge and then attempts to re-install. Previous purges were not completely purging and leaving some odd ownership when done (ownership is also fixed on reinstall)

Apport:

The apport script wasn't in the package so it wasn't too useful, in addition it wasn't collecting the right stuff, nor was it asking for permission since the files need root priveleges and main contain sensitive info. I stole most of this from the source_xorg.py file at Bryce Harrington's suggestion. Tested this and it works well.

Here's a bug it generated (note: in this bug the users.conf was not collected properly):
https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/1067591

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/lightdm.install'
2--- debian/lightdm.install 2011-09-30 14:49:44 +0000
3+++ debian/lightdm.install 2012-11-06 21:18:20 +0000
4@@ -1,7 +1,6 @@
5 usr/sbin/lightdm
6 usr/share/man
7 usr/share/locale
8-usr/share/man
9 usr/lib/lightdm
10 usr/bin
11 etc/dbus-1/
12@@ -12,3 +11,4 @@
13 debian/lightdm-session usr/sbin
14 debian/guest-account usr/sbin
15 debian/lightdm-greeter-session usr/lib/lightdm
16+debian/source_lightdm.py usr/share/apport/package-hooks
17
18=== modified file 'debian/lightdm.postinst'
19--- debian/lightdm.postinst 2012-03-05 12:02:39 +0000
20+++ debian/lightdm.postinst 2012-11-06 21:18:20 +0000
21@@ -37,7 +37,7 @@
22 fi
23
24 if [ -d /var/lib/lightdm ]; then
25- chown lightdm:lightdm /var/lib/lightdm
26+ chown -R lightdm:lightdm /var/lib/lightdm
27 chmod 0750 /var/lib/lightdm
28 fi
29
30
31=== modified file 'debian/lightdm.postrm'
32--- debian/lightdm.postrm 2011-08-09 13:27:33 +0000
33+++ debian/lightdm.postrm 2012-11-06 21:18:20 +0000
34@@ -28,11 +28,20 @@
35 deluser --system lightdm
36 fi
37 fi
38+
39 if getent group lightdm >/dev/null; then
40 if [ -x /usr/sbin/delgroup ]; then
41 delgroup --system lightdm
42 fi
43 fi
44+
45+ # we cannot use the --remove-home option when we delete the user above
46+ # because it will refuse to remove things in /var, so clean it up this
47+ # way
48+ if [ -d /var/lib/lightdm ]; then
49+ rm -r /var/lib/lightdm
50+ fi
51+
52 fi
53 #DEBHELPER#
54 exit 0
55
56=== modified file 'debian/source_lightdm.py'
57--- debian/source_lightdm.py 2011-08-09 13:27:33 +0000
58+++ debian/source_lightdm.py 2012-11-06 21:18:20 +0000
59@@ -1,13 +1,28 @@
60 import os
61 import re
62
63-import apport.packaging
64-import apport.hookutils
65+from apport.hookutils import *
66
67 def add_info(report, ui):
68
69- report["Log"] = apport.hookutils.read_file("/var/log/lightdm/:0.log")
70- report["LightdmLog"] = apport.hookutils.read_file("/var/log/lightdm/lightdm.log")
71- report["GreeterLog"] = apport.hookutils.read_file("/var/log/lightdm/:0-greeter.log")
72- report["XorgLog"] = apport.hookutils.read_file("/var/log/Xorg.0.log")
73+ if ui:
74+ display_manager_files = {}
75+ if os.path.lexists('/var/log/lightdm'):
76+ display_manager_files['LightdmLog'] = \
77+ 'cat /var/log/lightdm/lightdm.log'
78+ display_manager_files['LightdmDisplayLog'] = \
79+ 'cat /var/log/lightdm/x-0.log'
80+ display_manager_files['LightdmGreeterLog'] = \
81+ 'cat /var/log/lightdm/x-0-greeter.log'
82+ display_manager_files['LightdmGreeterLogOld'] = \
83+ 'cat /var/log/lightdm/x-0-greeter.log.old'
84+ display_manager_files['LightdmConfig'] = \
85+ 'cat /etc/lightdm/lightdm.conf'
86+ display_manager_files['LightdmUsersConfig'] = \
87+ 'cat /etc/lightdm/users.conf'
88
89+ if ui.yesno("Your display manager log files may help developers"\
90+ " diagnose the bug, but may contain sensitive information"\
91+ " such as your hostname or username. Do you want to"\
92+ " include these logs in your bug report?") == True:
93+ attach_root_command_outputs(report, display_manager_files)

Subscribers

People subscribed via source and target branches

to all changes: