| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
case "$1" in |
| 6 |
(configure) |
| 7 |
# Use setcap on Linux only (setuid setting see debian/rules) |
| 8 |
if [ "$(uname -s)" = "Linux" ]; then |
| 9 |
if ! setcap cap_net_raw+ep /usr/bin/fping; then |
| 10 |
echo "WARNING: 'setcap cap_net_raw+ep /usr/bin/fping' failed." 1>&2 |
| 11 |
if dpkg-statoverride --list /usr/bin/fping > /dev/null; then |
| 12 |
if dpkg-statoverride --list /usr/bin/fping | fgrep -q 4755; then |
| 13 |
echo "/usr/bin/fping is already setuid root. Not trying to fix anything." 1>&2 |
| 14 |
else |
| 15 |
echo "A local statoverride for /usr/bin/fping already exists. Not trying to fix anything." 1>&2 |
| 16 |
fi |
| 17 |
else |
| 18 |
echo "WARNING: Making /usr/bin/fping setuid instead. Use dpkg-statoverride(1) to change that if you're unhappy with it." 1>&2 |
| 19 |
dpkg-statoverride --update --add root root 4755 /usr/bin/fping |
| 20 |
fi |
| 21 |
fi |
| 22 |
fi |
| 23 |
;; |
| 24 |
(abort-upgrade|abort-remove|abort-deconfigure) |
| 25 |
exit 0 |
| 26 |
;; |
| 27 |
(*) |
| 28 |
echo "postinst called with unknown argument \`$1'" >&2 |
| 29 |
exit 0 |
| 30 |
;; |
| 31 |
esac |
| 32 |
|
| 33 |
#DEBHELPER# |