OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
python3
/
dist-packages
/
DistUpgrade
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/17/2025 09:32:20 AM
rwxr-xr-x
📄
DistUpgradeApport.py
4.95 KB
06/03/2019 12:51:27 PM
rw-r--r--
📄
DistUpgradeAptCdrom.py
12.39 KB
06/06/2019 06:46:11 PM
rw-r--r--
📄
DistUpgradeCache.py
52.55 KB
06/19/2019 04:49:56 PM
rw-r--r--
📄
DistUpgradeConfigParser.py
3.75 KB
06/19/2019 04:49:56 PM
rw-r--r--
📄
DistUpgradeController.py
100.96 KB
10/05/2020 08:50:15 PM
rw-r--r--
📄
DistUpgradeFetcher.py
5.83 KB
06/06/2019 06:46:11 PM
rw-r--r--
📄
DistUpgradeFetcherCore.py
11.2 KB
06/06/2019 06:46:11 PM
rw-r--r--
📄
DistUpgradeFetcherKDE.py
9.72 KB
06/06/2019 06:46:11 PM
rw-r--r--
📄
DistUpgradeFetcherSelf.py
2.02 KB
06/03/2019 12:51:27 PM
rw-r--r--
📄
DistUpgradeGettext.py
2.97 KB
06/03/2019 12:51:27 PM
rw-r--r--
📄
DistUpgradeMain.py
9.1 KB
06/06/2019 06:46:11 PM
rw-r--r--
📄
DistUpgradePatcher.py
3.92 KB
06/03/2019 12:51:27 PM
rw-r--r--
📄
DistUpgradeQuirks.py
47.38 KB
04/20/2021 09:36:27 PM
rw-r--r--
📄
DistUpgradeVersion.py
21 bytes
09/03/2021 05:16:06 PM
rw-r--r--
📄
DistUpgradeView.py
16.2 KB
06/19/2019 04:49:56 PM
rw-r--r--
📄
DistUpgradeViewGtk3.py
32.7 KB
06/19/2019 04:49:56 PM
rw-r--r--
📄
DistUpgradeViewKDE.py
39.87 KB
06/19/2019 04:49:56 PM
rw-r--r--
📄
DistUpgradeViewNonInteractive.py
13.45 KB
06/19/2019 04:49:56 PM
rw-r--r--
📄
DistUpgradeViewText.py
12.33 KB
06/19/2019 04:49:56 PM
rw-r--r--
📄
GtkProgress.py
3.93 KB
06/03/2019 12:51:27 PM
rw-r--r--
📄
MetaRelease.py
16.65 KB
01/14/2019 09:40:08 PM
rw-r--r--
📄
QUrlOpener.py
3.24 KB
06/06/2019 06:46:11 PM
rw-r--r--
📄
ReleaseNotesViewer.py
7.48 KB
06/06/2019 06:46:11 PM
rw-r--r--
📄
ReleaseNotesViewerWebkit.py
2.86 KB
06/03/2019 12:51:27 PM
rw-r--r--
📄
SimpleGtk3builderApp.py
2.01 KB
06/03/2019 12:51:27 PM
rw-r--r--
📄
SimpleGtkbuilderApp.py
1.99 KB
06/03/2019 12:51:27 PM
rw-r--r--
📄
__init__.py
0 bytes
06/03/2019 12:51:27 PM
rw-r--r--
📁
__pycache__
-
05/09/2024 07:15:53 AM
rwxr-xr-x
📄
apt_btrfs_snapshot.py
9.64 KB
09/03/2021 05:16:06 PM
rw-r--r--
📄
apt_clone.py
32.81 KB
11/13/2015 07:58:15 PM
rw-r--r--
📄
dist-upgrade.py
126 bytes
06/03/2019 12:51:27 PM
rw-r--r--
📄
distinfo.py
11.3 KB
04/29/2021 07:33:02 PM
rw-r--r--
📄
distro.py
23.16 KB
04/29/2021 07:33:02 PM
rw-r--r--
📄
sourceslist.py
18.36 KB
04/29/2021 07:33:02 PM
rw-r--r--
📄
telemetry.py
3.4 KB
06/06/2019 06:46:11 PM
rw-r--r--
📄
utils.py
17.95 KB
04/09/2019 11:03:43 PM
rw-r--r--
📄
xorg_fix_proprietary.py
3.93 KB
06/19/2019 04:49:56 PM
rw-r--r--
Editing: DistUpgradeApport.py
Close
import os import logging import subprocess import sys import gettext import errno APPORT_WHITELIST = { "apt.log": "Aptlog", "apt-term.log": "Apttermlog", "apt-clone_system_state.tar.gz": "Aptclonesystemstate.tar.gz", "history.log": "Historylog", "lspci.txt": "Lspcitxt", "main.log": "Mainlog", "term.log": "Termlog", "screenlog.0": "Screenlog", "xorg_fixup.log": "Xorgfixup", } def _apport_append_logfiles(report, logdir="/var/log/dist-upgrade/"): dirname = 'VarLogDistupgrade' for fname in APPORT_WHITELIST: f = os.path.join(logdir, fname) if not os.path.isfile(f) or os.path.getsize(f) == 0: continue ident = dirname + APPORT_WHITELIST[fname] if os.access(f, os.R_OK): report[ident] = (open(f), ) elif os.path.exists(f): try: from apport.hookutils import root_command_output report[ident] = root_command_output( ["cat", '%s' % f], decode_utf8=False) except ImportError: logging.error("failed to import apport python module, " "can't include: %s" % ident) def apport_crash(type, value, tb): logging.debug("running apport_crash()") if "RELEASE_UPRADER_NO_APPORT" in os.environ: logging.debug("RELEASE_UPRADER_NO_APPORT env set") return False try: # we don't depend on python3-apport because of servers from apport_python_hook import apport_excepthook from apport.report import Report except ImportError as e: logging.error("failed to import apport python module, can't " "generate crash: %s" % e) return False from .DistUpgradeVersion import VERSION # we pretend we are do-release-upgrade sys.argv[0] = "/usr/bin/do-release-upgrade" apport_excepthook(type, value, tb) # now add the files in /var/log/dist-upgrade/* if os.path.exists('/var/crash/_usr_bin_do-release-upgrade.0.crash'): report = Report() report.setdefault('Tags', 'dist-upgrade') release = 'Ubuntu %s' % VERSION[0:5] report.setdefault('DistroRelease', release) # use the version of the release-upgrader tarball, not the installed # package report.setdefault('Package', 'ubuntu-release-upgrader-core 1:%s' % VERSION) _apport_append_logfiles(report) report.add_to_existing( '/var/crash/_usr_bin_do-release-upgrade.0.crash') return True def apport_pkgfailure(pkg, errormsg): logging.debug("running apport_pkgfailure() %s: %s", pkg, errormsg) if "RELEASE_UPRADER_NO_APPORT" in os.environ: logging.debug("RELEASE_UPRADER_NO_APPORT env set") return False LOGDIR = "/var/log/dist-upgrade/" s = "/usr/share/apport/package_hook" # we do not report followup errors from earlier failures # dpkg messages will not be translated if DPKG_UNTRANSLATED_MESSAGES is # set which it is by default so check for the English message first if "dependency problems - leaving unconfigured" in errormsg: logging.debug("dpkg error because of dependency problems, not " "reporting against %s " % pkg) return False needle = gettext.dgettext( 'dpkg', "dependency problems - leaving unconfigured") if needle in errormsg: logging.debug("dpkg error because of dependency problems, not " "reporting against %s " % pkg) return False # we do not run apport_pkgfailure for full disk errors if os.strerror(errno.ENOSPC) in errormsg: logging.debug("dpkg error because of full disk, not reporting " "against %s " % pkg) return False if os.path.exists(s): args = [s, "-p", pkg] args.extend(["--tags", "dist-upgrade"]) for fname in APPORT_WHITELIST: args.extend(["-l", os.path.join(LOGDIR, fname)]) try: p = subprocess.Popen(args, stdin=subprocess.PIPE, universal_newlines=True) p.stdin.write(errormsg) p.stdin.close() #p.wait() except Exception as e: logging.warning("Failed to run apport (%s)" % e) return False return True return False def run_apport(): " run apport, check if we have a display " if "RELEASE_UPRADER_NO_APPORT" in os.environ: logging.debug("RELEASE_UPRADER_NO_APPORT env set") return False if "DISPLAY" in os.environ: # update-notifier will notify about the crash return True elif os.path.exists("/usr/bin/apport-cli"): try: return (subprocess.call("/usr/bin/apport-cli") == 0) except Exception: logging.exception("Unable to launch '/usr/bin/apport-cli'") return False logging.debug("can't find apport") return False if __name__ == "__main__": apport_crash(None, None, None)