summaryrefslogtreecommitdiff
path: root/debian/apt.postinst
diff options
context:
space:
mode:
authorJohannes Schauer Marin Rodrigues <josch@debian.org>2022-09-18 14:26:55 +0200
committerJohannes Schauer Marin Rodrigues <josch@debian.org>2022-09-23 23:00:57 +0200
commitf6954267f5df0a8a7f8c3f97033f121297d869a5 (patch)
tree2b9464f9e42bde046d67d74515d075c1521ef692 /debian/apt.postinst
parent8d3540402799860eb76cd112d82efb4275f19e46 (diff)
since base-passwd 3.6.1 the _apt user is in the default /etc/passwd
- so do not call adduser if the _apt user already exists - make adduser dependency optional if base-passwd >= 3.6.1 - do not call adduser if $DPKG_ROOT is non-empty as adduser doesn't support working on a custom root directory
Diffstat (limited to 'debian/apt.postinst')
-rwxr-xr-xdebian/apt.postinst2
1 files changed, 1 insertions, 1 deletions
diff --git a/debian/apt.postinst b/debian/apt.postinst
index 8a623f2fd..54a0770b7 100755
--- a/debian/apt.postinst
+++ b/debian/apt.postinst
@@ -1,7 +1,7 @@
#! /bin/sh
set -e
-if [ "$1" = 'configure' ]; then
+if [ "$1" = 'configure' ] && [ -z "$DPKG_ROOT" ] && ! getent passwd _apt >/dev/null; then
# add unprivileged user for the apt methods
adduser --force-badname --system --home /nonexistent \
--no-create-home --quiet _apt || true