summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schauer Marin Rodrigues <josch@debian.org>2021-10-23 18:45:33 +0000
committerJohannes Schauer Marin Rodrigues <josch@debian.org>2021-10-23 18:45:33 +0000
commitb7878255ff847ce49907787fd8933374b95b77b4 (patch)
tree8531ef6e2a311a64a246f08c3d831211a2b82f7d
parentcfc17bfaa78993b802e255d7d57e193b6d39862c (diff)
parent06d1bd8617d04b1e8812160d39d70c97085b3282 (diff)
downloadshadow-b7878255ff847ce49907787fd8933374b95b77b4.tar.gz
Merge branch 'dpkg-root' into 'master'
cruft removal and support for DPKG_ROOT (closes: #989712, #992578) See merge request debian/shadow!15
-rw-r--r--debian/login.postinst49
1 files changed, 12 insertions, 37 deletions
diff --git a/debian/login.postinst b/debian/login.postinst
index f4c3ce02..2261e1b6 100644
--- a/debian/login.postinst
+++ b/debian/login.postinst
@@ -2,54 +2,29 @@
set -e
-if test "$1" = configure
-then
- if test -f /etc/init.d/logoutd
- then
- if test "$(md5sum /etc/init.d/logoutd)" = "9080f92783dd53f6f2108e698c06bd53 /etc/init.d/logoutd"
- then
- echo "removing logoutd cruft"
- rm /etc/init.d/logoutd
- update-rc.d logoutd remove
- fi
- fi
-fi
if [ "$1" = "configure" ]; then
# Install faillog during initial installs only
- if [ "$2" = "" ] && [ ! -f /var/log/faillog ] ; then
- touch /var/log/faillog
- chown root:root /var/log/faillog
- chmod 644 /var/log/faillog
+ if [ "$2" = "" ] && [ ! -f "$DPKG_ROOT/var/log/faillog" ] ; then
+ touch "$DPKG_ROOT/var/log/faillog"
+ chown 0:0 "$DPKG_ROOT/var/log/faillog"
+ chmod 644 "$DPKG_ROOT/var/log/faillog"
fi
# Create subuid/subgid if missing
- if [ ! -e /etc/subuid ]; then
- touch /etc/subuid
- chown root:root /etc/subuid
- chmod 644 /etc/subuid
+ if [ ! -e "$DPKG_ROOT/etc/subuid" ]; then
+ touch "$DPKG_ROOT/etc/subuid"
+ chown 0:0 "$DPKG_ROOT/etc/subuid"
+ chmod 644 "$DPKG_ROOT/etc/subuid"
fi
- if [ ! -e /etc/subgid ]; then
- touch /etc/subgid
- chown root:root /etc/subgid
- chmod 644 /etc/subgid
+ if [ ! -e "$DPKG_ROOT/etc/subgid" ]; then
+ touch "$DPKG_ROOT/etc/subgid"
+ chown 0:0 "$DPKG_ROOT/etc/subgid"
+ chmod 644 "$DPKG_ROOT/etc/subgid"
fi
fi
- # Create subuid/subgid if missing
- if [ ! -e /etc/subuid ]; then
- touch /etc/subuid
- chown root:root /etc/subuid
- chmod 644 /etc/subuid
- fi
-
- if [ ! -e /etc/subgid ]; then
- touch /etc/subgid
- chown root:root /etc/subgid
- chmod 644 /etc/subgid
- fi
-
#DEBHELPER#
exit 0