OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
python3
/
dist-packages
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
10/21/2019 03:48:35 PM
rwxr-xr-x
📁
Automat-0.6.0.egg-info
-
10/21/2019 03:49:23 PM
rwxr-xr-x
📁
CommandNotFound
-
05/09/2024 07:14:56 AM
rwxr-xr-x
📁
ConfigArgParse-0.11.0.egg-info
-
07/12/2020 04:36:14 PM
rwxr-xr-x
📁
Crypto
-
05/09/2024 06:57:58 AM
rwxr-xr-x
📁
DistUpgrade
-
05/09/2024 07:15:53 AM
rwxr-xr-x
📁
HweSupportStatus
-
10/28/2024 08:41:33 AM
rwxr-xr-x
📁
Jinja2-2.10.egg-info
-
10/21/2019 03:49:31 PM
rwxr-xr-x
📁
LanguageSelector
-
10/21/2019 03:50:05 PM
rwxr-xr-x
📁
MarkupSafe-1.0.egg-info
-
10/21/2019 03:49:31 PM
rwxr-xr-x
📁
OpenSSL
-
10/21/2019 03:50:02 PM
rwxr-xr-x
📄
PAM-0.4.2.egg-info
193 bytes
08/04/2017 04:59:28 AM
rw-r--r--
📄
PAM.cpython-36m-x86_64-linux-gnu.so
19.42 KB
08/04/2017 04:59:28 AM
rw-r--r--
📄
PyICU-1.9.8.egg-info
10.32 KB
11/09/2017 07:22:14 AM
rw-r--r--
📄
PyICU.py
1.43 KB
02/08/2016 11:30:00 PM
rw-r--r--
📁
PyJWT-1.5.3.egg-info
-
07/20/2022 06:59:45 AM
rwxr-xr-x
📄
PyYAML-3.12.egg-info
1.48 KB
08/05/2017 04:28:08 PM
rw-r--r--
📄
README.txt
119 bytes
03/10/2023 04:46:00 PM
rw-r--r--
📁
SecretStorage-2.3.1.egg-info
-
05/09/2024 06:57:57 AM
rwxr-xr-x
📁
Twisted-17.9.0.egg-info
-
03/31/2022 06:22:38 AM
rwxr-xr-x
📁
UpdateManager
-
10/28/2024 08:41:33 AM
rwxr-xr-x
📁
__pycache__
-
11/10/2024 09:42:49 AM
rwxr-xr-x
📄
_cffi_backend.cpython-36m-x86_64-linux-gnu.so
165.56 KB
02/27/2018 07:34:07 PM
rw-r--r--
📄
_dbus_bindings.cpython-36m-x86_64-linux-gnu.so
155.67 KB
01/29/2018 07:57:57 PM
rw-r--r--
📄
_dbus_glib_bindings.cpython-36m-x86_64-linux-gnu.so
18.7 KB
01/29/2018 07:57:57 PM
rw-r--r--
📄
_icu.cpython-36m-x86_64-linux-gnu.so
710.82 KB
11/09/2017 07:22:14 AM
rw-r--r--
📄
_snack.cpython-36m-x86_64-linux-gnu.so
42.59 KB
01/12/2018 04:42:24 PM
rw-r--r--
📄
_version.py
21 bytes
08/26/2014 01:11:36 AM
rw-r--r--
📄
_yaml.cpython-36m-x86_64-linux-gnu.so
220.16 KB
08/05/2017 04:28:08 PM
rw-r--r--
📁
acme
-
07/12/2020 04:36:20 PM
rwxr-xr-x
📁
acme-0.31.0.egg-info
-
07/12/2020 04:36:14 PM
rwxr-xr-x
📁
apport
-
05/09/2024 07:15:23 AM
rwxr-xr-x
📄
apport_python_hook.py
7.87 KB
05/13/2020 10:12:14 PM
rw-r--r--
📁
apt
-
05/09/2024 07:14:28 AM
rwxr-xr-x
📄
apt_inst.cpython-36m-x86_64-linux-gnu.so
50.37 KB
12/01/2022 12:36:29 PM
rw-r--r--
📄
apt_inst.pyi
227 bytes
12/01/2022 12:36:29 PM
rw-r--r--
📄
apt_pkg.cpython-36m-x86_64-linux-gnu.so
338.66 KB
12/01/2022 12:36:29 PM
rw-r--r--
📄
apt_pkg.pyi
8.69 KB
12/01/2022 12:36:29 PM
rw-r--r--
📁
aptsources
-
05/09/2024 07:14:28 AM
rwxr-xr-x
📁
asn1crypto
-
10/21/2019 03:49:46 PM
rwxr-xr-x
📁
asn1crypto-0.24.0.egg-info
-
10/21/2019 03:49:23 PM
rwxr-xr-x
📁
attr
-
10/21/2019 03:49:50 PM
rwxr-xr-x
📁
attrs-17.4.0.egg-info
-
10/21/2019 03:49:23 PM
rwxr-xr-x
📁
automat
-
10/21/2019 03:49:51 PM
rwxr-xr-x
📁
blinker
-
10/21/2019 03:49:46 PM
rwxr-xr-x
📄
blinker-1.4.egg-info
3.81 KB
01/11/2018 02:57:15 PM
rw-r--r--
📁
certbot
-
05/25/2021 01:14:26 PM
rwxr-xr-x
📁
certbot-0.31.0.egg-info
-
05/25/2021 01:14:26 PM
rwxr-xr-x
📁
certbot_dns_digitalocean
-
05/25/2021 01:14:28 PM
rwxr-xr-x
📁
certbot_dns_digitalocean-0.23.0.egg-info
-
05/25/2021 01:14:26 PM
rwxr-xr-x
📁
certifi
-
10/21/2019 03:49:43 PM
rwxr-xr-x
📁
certifi-2018.1.18.egg-info
-
10/21/2019 03:49:19 PM
rwxr-xr-x
📁
chardet
-
10/21/2019 03:49:47 PM
rwxr-xr-x
📁
chardet-3.0.4.egg-info
-
10/21/2019 03:49:15 PM
rwxr-xr-x
📁
click
-
10/21/2019 03:49:53 PM
rwxr-xr-x
📁
click-6.7.egg-info
-
10/21/2019 03:49:31 PM
rwxr-xr-x
📁
cloud_init-23.1.2.egg-info
-
05/09/2024 07:14:27 AM
rwxr-xr-x
📁
cloudinit
-
05/09/2024 07:15:07 AM
rwxr-xr-x
📁
colorama
-
10/21/2019 03:49:43 PM
rwxr-xr-x
📁
colorama-0.3.7.egg-info
-
10/21/2019 03:49:31 PM
rwxr-xr-x
📄
command_not_found-0.3.egg-info
189 bytes
02/14/2022 05:26:36 PM
rw-r--r--
📄
configargparse.py
40.35 KB
09/05/2016 01:22:39 AM
rw-r--r--
📁
configobj-5.0.6.egg-info
-
05/09/2024 07:14:03 AM
rwxr-xr-x
📄
configobj.py
87.51 KB
02/05/2018 01:01:15 PM
rw-r--r--
📁
constantly
-
10/21/2019 03:49:41 PM
rwxr-xr-x
📁
constantly-15.1.0.egg-info
-
10/21/2019 03:49:23 PM
rwxr-xr-x
📁
cryptography
-
11/05/2020 06:02:51 AM
rwxr-xr-x
📁
cryptography-2.1.4.egg-info
-
11/05/2020 06:02:51 AM
rwxr-xr-x
📄
cv2.cpython-36m-x86_64-linux-gnu.so
2.78 MB
09/20/2018 09:28:13 AM
rw-r--r--
📁
dbus
-
10/21/2019 03:48:44 PM
rwxr-xr-x
📄
deb822.py
146 bytes
02/17/2018 05:37:18 AM
rw-r--r--
📄
debconf.py
6.61 KB
05/06/2019 04:30:30 PM
rw-r--r--
📁
debian
-
10/21/2019 03:49:51 PM
rwxr-xr-x
📁
debian_bundle
-
10/21/2019 03:49:51 PM
rwxr-xr-x
📁
digitalocean
-
05/25/2021 01:14:28 PM
rwxr-xr-x
📁
distro_info-0.18ubuntu0.18.04.1.egg-info
-
10/21/2019 03:49:16 PM
rwxr-xr-x
📄
distro_info.py
10.68 KB
03/07/2019 07:33:56 PM
rw-r--r--
📁
distro_info_test
-
10/21/2019 03:49:40 PM
rwxr-xr-x
📄
easy_install.py
126 bytes
03/18/2018 02:41:50 PM
rw-r--r--
📁
future
-
07/12/2020 04:36:17 PM
rwxr-xr-x
📁
future-0.15.2.egg-info
-
07/12/2020 04:36:14 PM
rwxr-xr-x
📁
gi
-
10/21/2019 03:49:07 PM
rwxr-xr-x
📁
httplib2
-
05/09/2024 07:15:03 AM
rwxr-xr-x
📄
httplib2-0.9.2.egg-info
2.22 KB
12/15/2020 08:09:40 PM
rw-r--r--
📁
hyperlink
-
10/21/2019 03:49:51 PM
rwxr-xr-x
📁
hyperlink-17.3.1.egg-info
-
10/21/2019 03:49:23 PM
rwxr-xr-x
📁
icu
-
07/12/2020 04:36:17 PM
rwxr-xr-x
📁
idna
-
10/21/2019 03:49:42 PM
rwxr-xr-x
📁
idna-2.6.egg-info
-
10/21/2019 03:49:19 PM
rwxr-xr-x
📁
incremental
-
10/21/2019 03:49:40 PM
rwxr-xr-x
📁
incremental-16.10.1.egg-info
-
10/21/2019 03:49:23 PM
rwxr-xr-x
📁
janitor
-
10/28/2024 08:41:33 AM
rwxr-xr-x
📁
jinja2
-
10/21/2019 03:49:48 PM
rwxr-xr-x
📁
josepy
-
07/12/2020 04:36:18 PM
rwxr-xr-x
📁
josepy-1.1.0.egg-info
-
07/12/2020 04:36:14 PM
rwxr-xr-x
📁
jsonpatch-1.16.egg-info
-
10/21/2019 03:49:31 PM
rwxr-xr-x
📄
jsonpatch.py
26.19 KB
06/15/2017 03:41:06 PM
rw-r--r--
📁
jsonpickle
-
05/25/2021 01:14:27 PM
rwxr-xr-x
📄
jsonpickle-0.9.5.egg-info
1.01 KB
08/21/2017 09:29:37 AM
rw-r--r--
📁
jsonpointer-1.10.egg-info
-
10/21/2019 03:49:31 PM
rwxr-xr-x
📄
jsonpointer.py
9.15 KB
10/28/2015 07:06:37 PM
rw-r--r--
📁
jsonschema
-
10/21/2019 03:49:46 PM
rwxr-xr-x
📁
jsonschema-2.6.0.egg-info
-
10/21/2019 03:49:31 PM
rwxr-xr-x
📁
jwt
-
07/20/2022 06:59:45 AM
rwxr-xr-x
📁
keyring
-
05/09/2024 06:58:01 AM
rwxr-xr-x
📁
keyring-10.6.0.egg-info
-
05/09/2024 06:57:57 AM
rwxr-xr-x
📁
keyrings
-
05/09/2024 06:57:57 AM
rwxr-xr-x
📁
keyrings.alt-3.0.egg-info
-
05/09/2024 06:57:57 AM
rwxr-xr-x
📁
landscape
-
05/09/2024 07:14:55 AM
rwxr-xr-x
📁
language_selector-0.1.egg-info
-
10/21/2019 03:49:13 PM
rwxr-xr-x
📄
language_support_pkgs.py
9.89 KB
11/16/2017 08:34:16 PM
rw-r--r--
📁
libfuturize
-
07/12/2020 04:36:17 PM
rwxr-xr-x
📁
libpasteurize
-
07/12/2020 04:36:18 PM
rwxr-xr-x
📄
lsb_release.py
14.09 KB
08/07/2017 09:55:07 PM
rw-r--r--
📁
markupsafe
-
10/21/2019 03:49:45 PM
rwxr-xr-x
📁
mock
-
07/12/2020 04:36:16 PM
rwxr-xr-x
📁
mock-2.0.0.egg-info
-
07/12/2020 04:36:14 PM
rwxr-xr-x
📁
ndg
-
07/12/2020 04:36:18 PM
rwxr-xr-x
📁
ndg_httpsclient-0.4.4.egg-info
-
07/12/2020 04:36:14 PM
rwxr-xr-x
📁
netifaces-0.10.4.egg-info
-
10/21/2019 03:49:07 PM
rwxr-xr-x
📄
netifaces.cpython-36m-x86_64-linux-gnu.so
18.59 KB
08/04/2017 06:49:42 AM
rw-r--r--
📁
numpy
-
10/28/2024 08:45:52 AM
rwxr-xr-x
📁
numpy-1.13.3.egg-info
-
10/28/2024 08:45:52 AM
rwxr-xr-x
📁
oauthlib
-
10/21/2019 03:49:53 PM
rwxr-xr-x
📁
oauthlib-2.0.6.egg-info
-
10/21/2019 03:49:32 PM
rwxr-xr-x
📁
parsedatetime
-
07/12/2020 04:36:19 PM
rwxr-xr-x
📁
parsedatetime-2.4.egg-info
-
07/12/2020 04:36:14 PM
rwxr-xr-x
📁
past
-
07/12/2020 04:36:18 PM
rwxr-xr-x
📁
pbr
-
07/12/2020 04:36:16 PM
rwxr-xr-x
📁
pbr-3.1.1.egg-info
-
07/12/2020 04:36:14 PM
rwxr-xr-x
📁
pexpect
-
09/28/2022 06:45:12 AM
rwxr-xr-x
📄
pexpect-4.2.1.egg-info
2.23 KB
12/12/2016 02:59:09 PM
rw-r--r--
📁
pip
-
05/09/2024 06:58:02 AM
rwxr-xr-x
📁
pip-9.0.1.egg-info
-
05/09/2024 06:57:57 AM
rwxr-xr-x
📁
pkg_resources
-
05/09/2024 06:58:00 AM
rwxr-xr-x
📄
problem_report.py
26.28 KB
11/11/2019 09:57:56 PM
rw-r--r--
📁
ptyprocess
-
09/28/2022 06:45:11 AM
rwxr-xr-x
📁
pyOpenSSL-17.5.0.egg-info
-
10/21/2019 03:49:23 PM
rwxr-xr-x
📁
pyRFC3339-1.0.egg-info
-
07/12/2020 04:36:14 PM
rwxr-xr-x
📁
pyasn1
-
10/21/2019 03:49:47 PM
rwxr-xr-x
📁
pyasn1-0.4.2.egg-info
-
10/21/2019 03:49:23 PM
rwxr-xr-x
📁
pyasn1_modules
-
10/21/2019 03:49:49 PM
rwxr-xr-x
📄
pyasn1_modules-0.2.1.egg-info
1.68 KB
01/02/2018 11:18:24 AM
rw-r--r--
📄
pycrypto-2.6.1.egg-info
666 bytes
04/03/2018 01:26:21 PM
rw-r--r--
📄
pygobject-3.26.1.egg-info
1013 bytes
01/29/2019 12:46:03 PM
rw-r--r--
📁
pygtkcompat
-
10/21/2019 03:49:07 PM
rwxr-xr-x
📁
pyrfc3339
-
07/12/2020 04:36:19 PM
rwxr-xr-x
📄
pyserial-3.4.egg-info
1.62 KB
04/09/2018 11:57:25 AM
rw-r--r--
📄
python_apt-1.6.6.egg-info
226 bytes
12/01/2022 12:36:29 PM
rw-r--r--
📁
python_debian-0.1.32.egg-info
-
10/21/2019 03:49:15 PM
rwxr-xr-x
📁
python_digitalocean-1.13.2.egg-info
-
05/25/2021 01:14:26 PM
rwxr-xr-x
📁
pytz
-
07/12/2020 04:36:19 PM
rwxr-xr-x
📁
pytz-2018.3.egg-info
-
07/12/2020 04:36:14 PM
rwxr-xr-x
📄
pyxdg-0.25.egg-info
576 bytes
01/07/2021 02:49:21 AM
rw-r--r--
📁
requests
-
10/21/2019 03:49:53 PM
rwxr-xr-x
📁
requests-2.18.4.egg-info
-
10/21/2019 03:49:19 PM
rwxr-xr-x
📁
requests_toolbelt
-
07/12/2020 04:36:15 PM
rwxr-xr-x
📁
requests_toolbelt-0.8.0.egg-info
-
07/12/2020 04:36:14 PM
rwxr-xr-x
📁
requests_unixsocket
-
10/21/2019 03:50:04 PM
rwxr-xr-x
📁
requests_unixsocket-0.1.5.egg-info
-
10/21/2019 03:49:19 PM
rwxr-xr-x
📁
secretstorage
-
05/09/2024 06:58:01 AM
rwxr-xr-x
📁
serial
-
10/21/2019 03:49:40 PM
rwxr-xr-x
📁
service_identity
-
10/21/2019 03:50:02 PM
rwxr-xr-x
📁
service_identity-16.0.0.egg-info
-
10/21/2019 03:49:23 PM
rwxr-xr-x
📁
setuptools
-
05/09/2024 06:58:03 AM
rwxr-xr-x
📁
setuptools-39.0.1.egg-info
-
05/09/2024 06:57:58 AM
rwxr-xr-x
📁
six-1.11.0.egg-info
-
10/21/2019 03:49:15 PM
rwxr-xr-x
📄
six.py
30.16 KB
09/17/2017 06:46:32 PM
rw-r--r--
📄
snack.py
30.4 KB
01/12/2018 04:42:24 PM
rw-r--r--
📁
softwareproperties
-
05/09/2024 07:14:38 AM
rwxr-xr-x
📁
sos
-
03/17/2025 09:32:20 AM
rwxr-xr-x
📄
sos-4.4.egg-info
312 bytes
11/21/2024 02:52:56 PM
rw-r--r--
📁
ssh_import_id
-
10/21/2019 03:50:07 PM
rwxr-xr-x
📁
ssh_import_id-5.7.egg-info
-
10/21/2019 03:49:39 PM
rwxr-xr-x
📁
systemd
-
10/21/2019 03:49:48 PM
rwxr-xr-x
📄
systemd_python-234.egg-info
586 bytes
08/05/2017 04:28:04 PM
rw-r--r--
📁
twisted
-
03/31/2022 06:22:38 AM
rwxr-xr-x
📁
uaclient
-
10/28/2024 08:41:34 AM
rwxr-xr-x
📁
ubuntu_pro_client-8001.egg-info
-
10/28/2024 08:41:32 AM
rwxr-xr-x
📁
ufw
-
05/09/2024 07:15:19 AM
rwxr-xr-x
📄
ufw-0.36.egg-info
261 bytes
10/25/2021 05:30:24 PM
rw-r--r--
📁
unattended_upgrades-0.1.egg-info
-
05/09/2024 07:14:27 AM
rwxr-xr-x
📁
urllib3
-
10/07/2020 06:14:10 AM
rwxr-xr-x
📁
urllib3-1.22.egg-info
-
10/07/2020 06:14:10 AM
rwxr-xr-x
📄
validate.py
46.13 KB
08/26/2014 01:11:36 AM
rw-r--r--
📁
wheel
-
05/09/2024 06:58:00 AM
rwxr-xr-x
📁
wheel-0.30.0.egg-info
-
05/09/2024 06:57:58 AM
rwxr-xr-x
📁
xdg
-
05/09/2024 06:57:59 AM
rwxr-xr-x
📁
yaml
-
10/21/2019 03:48:44 PM
rwxr-xr-x
📁
zope
-
05/09/2024 07:14:32 AM
rwxr-xr-x
📄
zope.component-4.3.0-nspkg.pth
529 bytes
02/05/2018 01:00:17 PM
rw-r--r--
📁
zope.component-4.3.0.egg-info
-
07/12/2020 04:36:15 PM
rwxr-xr-x
📄
zope.event-4.2.0-nspkg.pth
299 bytes
03/25/2016 05:44:58 PM
rw-r--r--
📁
zope.event-4.2.0.egg-info
-
07/12/2020 04:36:15 PM
rwxr-xr-x
📄
zope.hookable-4.0.4-nspkg.pth
529 bytes
02/05/2018 12:24:34 PM
rw-r--r--
📁
zope.hookable-4.0.4.egg-info
-
07/12/2020 04:36:14 PM
rwxr-xr-x
📄
zope.interface-4.3.2-nspkg.pth
529 bytes
02/04/2018 09:30:45 AM
rw-r--r--
📁
zope.interface-4.3.2.egg-info
-
05/09/2024 07:14:26 AM
rwxr-xr-x
Editing: apport_python_hook.py
Close
'''Python sys.excepthook hook to generate apport crash dumps.''' # Copyright (c) 2006 - 2009 Canonical Ltd. # Authors: Robert Collins <robert@ubuntu.com> # Martin Pitt <martin.pitt@ubuntu.com> # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. See http://www.gnu.org/copyleft/gpl.html for # the full text of the license. import os import sys CONFIG = '/etc/default/apport' def enabled(): '''Return whether Apport should generate crash reports.''' # This doesn't use apport.packaging.enabled() because it is too heavyweight # See LP: #528355 import re try: with open(CONFIG) as f: conf = f.read() return re.search(r'^\s*enabled\s*=\s*0\s*$', conf, re.M) is None except IOError: # if the file does not exist, assume it's enabled return True def apport_excepthook(exc_type, exc_obj, exc_tb): '''Catch an uncaught exception and make a traceback.''' # create and save a problem report. Note that exceptions in this code # are bad, and we probably need a per-thread reentrancy guard to # prevent that happening. However, on Ubuntu there should never be # a reason for an exception here, other than [say] a read only var # or some such. So what we do is use a try - finally to ensure that # the original excepthook is invoked, and until we get bug reports # ignore the other issues. # import locally here so that there is no routine overhead on python # startup time - only when a traceback occurs will this trigger. try: # ignore 'safe' exit types. if exc_type in (KeyboardInterrupt, ): return # if python apt modules are not built for the python version than it # is not supported. LP: #1774843 try: import apt_pkg # make pyflakes happy apt_pkg.DATE except ImportError: return # do not do anything if apport was disabled if not enabled(): return try: from cStringIO import StringIO StringIO # pyflakes except ImportError: from io import StringIO import re, traceback from apport.fileutils import likely_packaged, get_recent_crashes # apport will look up the package from the executable path. try: binary = os.path.realpath(os.path.join(os.getcwd(), sys.argv[0])) except (TypeError, AttributeError, IndexError): # the module has mutated sys.argv, plan B try: binary = os.readlink('/proc/%i/exe' % os.getpid()) except OSError: return # for interactive python sessions, sys.argv[0] == ''; catch that and # other irregularities if not os.access(binary, os.X_OK) or not os.path.isfile(binary): return # filter out binaries in user accessible paths if not likely_packaged(binary): return import apport.report pr = apport.report.Report() # special handling of dbus-python exceptions if hasattr(exc_obj, 'get_dbus_name'): name = exc_obj.get_dbus_name() if name == 'org.freedesktop.DBus.Error.NoReply': # NoReply is an useless crash, we do not even get the method it # was trying to call; needs actual crash from D-BUS backend (LP #914220) return elif name == 'org.freedesktop.DBus.Error.ServiceUnknown': dbus_service_unknown_analysis(exc_obj, pr) else: pr['_PythonExceptionQualifier'] = name # disambiguate OSErrors with errno: if exc_type == OSError and exc_obj.errno is not None: pr['_PythonExceptionQualifier'] = str(exc_obj.errno) # append a basic traceback. In future we may want to include # additional data such as the local variables, loaded modules etc. tb_file = StringIO() traceback.print_exception(exc_type, exc_obj, exc_tb, file=tb_file) pr['Traceback'] = tb_file.getvalue().strip() pr.add_proc_info(extraenv=['PYTHONPATH', 'PYTHONHOME']) pr.add_user_info() # override the ExecutablePath with the script that was actually running pr['ExecutablePath'] = binary if 'ExecutableTimestamp' in pr: pr['ExecutableTimestamp'] = str(int(os.stat(binary).st_mtime)) try: pr['PythonArgs'] = '%r' % sys.argv except AttributeError: pass if pr.check_ignored(): return mangled_program = re.sub('/', '_', binary) # get the uid for now, user name later user = os.getuid() pr_filename = '%s/%s.%i.crash' % (os.environ.get( 'APPORT_REPORT_DIR', '/var/crash'), mangled_program, user) crash_counter = 0 if os.path.exists(pr_filename): if apport.fileutils.seen_report(pr_filename): # flood protection with open(pr_filename, 'rb') as f: crash_counter = get_recent_crashes(f) + 1 if crash_counter > 1: return # remove the old file, so that we can create the new one with # os.O_CREAT|os.O_EXCL os.unlink(pr_filename) else: # don't clobber existing report return if crash_counter: pr['CrashCounter'] = str(crash_counter) with os.fdopen(os.open(pr_filename, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o640), 'wb') as f: pr.write(f) finally: # resume original processing to get the default behaviour, # but do not trigger an AttributeError on interpreter shutdown. if sys: sys.__excepthook__(exc_type, exc_obj, exc_tb) def dbus_service_unknown_analysis(exc_obj, report): from glob import glob import subprocess, re try: from configparser import ConfigParser, NoSectionError, NoOptionError (ConfigParser, NoSectionError, NoOptionError) # pyflakes except ImportError: # Python 2 from ConfigParser import ConfigParser, NoSectionError, NoOptionError # determine D-BUS name m = re.search(r'name\s+(\S+)\s+was not provided by any .service', exc_obj.get_dbus_message()) if not m: if sys.stderr: sys.stderr.write('Error: cannot parse D-BUS name from exception: ' + exc_obj.get_dbus_message()) return dbus_name = m.group(1) # determine .service file and Exec name for the D-BUS name services = [] # tuples of (service file, exe name, running) for f in glob('/usr/share/dbus-1/*services/*.service'): cp = ConfigParser(interpolation=None) cp.read(f, encoding='UTF-8') try: if cp.get('D-BUS Service', 'Name') == dbus_name: exe = cp.get('D-BUS Service', 'Exec') running = (subprocess.call(['pidof', '-sx', exe], stdout=subprocess.PIPE) == 0) services.append((f, exe, running)) except (NoSectionError, NoOptionError): if sys.stderr: sys.stderr.write('Invalid D-BUS .service file %s: %s' % ( f, exc_obj.get_dbus_message())) continue if not services: report['DbusErrorAnalysis'] = 'no service file providing ' + dbus_name else: report['DbusErrorAnalysis'] = 'provided by' for (service, exe, running) in services: report['DbusErrorAnalysis'] += ' %s (%s is %srunning)' % ( service, exe, ('' if running else 'not ')) def install(): '''Install the python apport hook.''' sys.excepthook = apport_excepthook