summaryrefslogtreecommitdiffstats
path: root/debian/tcpdump.postinst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:13:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:13:05 +0000
commitd89fede3849004be87494c62f2e5b8140c7d69c5 (patch)
tree5e000e46fe2807586a9ae25d96e7ab043323d91e /debian/tcpdump.postinst
parentAdding upstream version 4.99.4. (diff)
downloadtcpdump-d89fede3849004be87494c62f2e5b8140c7d69c5.tar.xz
tcpdump-d89fede3849004be87494c62f2e5b8140c7d69c5.zip
Adding debian version 4.99.4-3.debian/4.99.4-3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xdebian/tcpdump.postinst28
1 files changed, 28 insertions, 0 deletions
diff --git a/debian/tcpdump.postinst b/debian/tcpdump.postinst
new file mode 100755
index 0000000..a3a5f95
--- /dev/null
+++ b/debian/tcpdump.postinst
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+set -e
+
+if ! getent group tcpdump >/dev/null 2>&1; then
+ addgroup --system --quiet tcpdump
+fi
+if ! getent passwd tcpdump >/dev/null 2>&1; then
+ adduser --system --quiet --ingroup tcpdump \
+ --no-create-home --home /nonexistent \
+ tcpdump
+fi
+
+# dh_apparmor leaves behind the local profile for the old binary
+# location (/usr/sbin/tcpdump), we need to clean it up (#990554).
+#
+# Only remove it if it's empty, meaning that the system doesn't have
+# local configuration.
+if dpkg --compare-versions "$2" lt-nl "4.99.1-3~"; then
+ OLD_LOCAL_APP_PROFILE="/etc/apparmor.d/local/usr.sbin.tcpdump"
+ if [ -e "$OLD_LOCAL_APP_PROFILE" ]; then
+ if [ ! -s "$OLD_LOCAL_APP_PROFILE" ]; then
+ rm -f "$OLD_LOCAL_APP_PROFILE"
+ fi
+ fi
+fi
+
+#DEBHELPER#