/usr/bin/apport-bug is in apport 2.0.1-0ubuntu17.15.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | #!/bin/sh -e
# Determine the most appropriate Apport user interface (GTK/KDE/CLI) and file a
# bug with it.
#
# Copyright (C) 2009 Canonical Ltd.
# Author: 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.
# Explicitly set the PATH to that of ENV_SUPATH in /etc/login.defs and unset
# ENV and CDPATH. We need do this so that confined applications using
# ubuntu-browsers.d/ubuntu-integration cannot abuse the environment to escape
# AppArmor confinement via this script (LP: #1045986). This can be removed once
# AppArmor supports environment filtering (LP: #1045985)
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export ENV=
export CDPATH=
# locate path of a particular program
find_program() {
for p in /usr/local/bin /usr/bin /usr/local/share/apport /usr/share/apport; do
if [ -x $p/$1 ]; then
RET=$p/$1
return
fi
done
unset RET
}
# determine which UIs are available, and where
find_programs() {
find_program "apport-cli"
CLI="$RET"
find_program "apport-gtk"
GTK="$RET"
find_program "apport-kde"
KDE="$RET"
# find a terminal emulator
}
#
# main
#
find_programs
export APPORT_INVOKED_AS="$0"
# check for X
if [ -z "$DISPLAY" ]; then
if [ -x "$CLI" ] ; then
"$CLI" "$@"
else
echo "\$DISPLAY is not set. You need apport-cli to make this program work." >&2
exit 1
fi
# do we have a running Gnome/KDE session?
elif pgrep -u `id -u` -x gnome-session >/dev/null && \
[ -x "$GTK" ]; then
"$GTK" "$@"
elif pgrep -u `id -u` -x ksmserver >/dev/null && \
[ -x "$KDE" ]; then
"$KDE" "$@"
# fall back to calling whichever is available
elif [ -x "$GTK" ]; then
"$GTK" "$@"
elif [ -x "$KDE" ]; then
"$KDE" "$@"
elif [ -x "$CLI" ]; then
if [ -z "$TERM" ] && [ -x "$XTERM" ]; then
"$XTERM" -e "$CLI" "$@"
else
"$CLI" "$@"
fi
else
echo "Neither apport-gtk, apport-kde or apport-cli are installed. Install either to make this program work." >&2
exit 1
fi
|