HEX
Server: nginx/1.26.1
System: Linux main-vm 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64
User: root (0)
PHP: 8.2.19
Disabled: NONE
Upload Files
File: //usr/share/apport/package-hooks/source_apport.py
'''Apport package hook for apport itself.

This adds /var/log/apport.log and the file listing in /var/crash to the report.
'''

# Copyright 2007 Canonical Ltd.
# Author: Martin Pitt <[email protected]>

from glob import glob
import apport.hookutils

APPORT_LOG = '/var/log/apport.log'


def add_info(report):
    apport.hookutils.attach_file_if_exists(report, APPORT_LOG, 'ApportLog')
    reports = glob('/var/crash/*')
    if reports:
        report['CrashReports'] = apport.hookutils.command_output(
            ['stat', '-c', '%a:%u:%g:%s:%y:%x:%n'] + reports)