7
from apport.hookutils import *
8
import apport.packaging
13
The contents of your /etc/fstab file and relevant log files may help
14
developers diagnose your bug more quickly. However, if you have modified
15
/etc/fstab, these files may contain sensitive information.
17
Do you want to include the files in your bug report? (you will be able
18
to review the data before it is sent)
21
def add_root_file(map, file):
23
Add @file to @map such that @map can be passed to
24
attach_root_command_outputs() to have @file attached to the report
25
event if it is unreadable by the current user.
27
if not os.path.exists(file):
30
key = path_to_key(file)
32
map[key] = 'cat %s' % file
35
def add_info(report, ui):
38
# files that are not readable by current user
41
problem_type = report.get('ProblemType', '')
43
if problem_type == 'Bug' and ui:
44
if ui.yesno(msg) == None:
47
elif problem_type == 'Crash':
48
# crash bugs are private by default
51
if attach_files == False:
54
attach_file(report, '/etc/fstab')
55
attach_file(report, '/etc/mtab')
56
attach_file(report, '/proc/cmdline', 'ProcKernelCmdline')
57
attach_file(report, '/proc/mounts', 'ProcMounts')
58
attach_file(report, '/proc/self/mountinfo', 'ProcSelfMountinfo')
59
attach_file_if_exists(report, '/run/mount/utab')
61
report['Mounts'] = apport.hookutils.command_output(['mount'])
63
# mountall logs to the console so until Upstart can log to both the
64
# console and a file, grab the plymouth log which captures the
66
add_root_file(unreadable_files, '/var/log/boot.log')
68
# in case admin changed the console stanza
69
add_root_file(unreadable_files, '/var/log/upstart/mountall.log')
71
attach_root_command_outputs(report, unreadable_files)