diff options
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | debian/libpam-modules.postinst | 8 | ||||
-rw-r--r-- | debian/libpam-runtime.postinst | 4 |
3 files changed, 8 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog index 659d1ca7..c76137a4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,8 @@ pam (1.5.2-3) UNRELEASED; urgency=medium file, it's covered by the existing globs. * debian/local/Debian-PAM-MiniPolicy: drop references to ancient package versions. Thanks, Marc Haber. + * Support DPKG_ROOT in the postinst scripts. Closes: #993161. + Thanks, Johannes Schauer Marin Rodrigues. -- Steve Langasek <vorlon@debian.org> Thu, 18 Aug 2022 18:26:29 +0000 diff --git a/debian/libpam-modules.postinst b/debian/libpam-modules.postinst index 723877cf..20b6bf17 100644 --- a/debian/libpam-modules.postinst +++ b/debian/libpam-modules.postinst @@ -5,16 +5,16 @@ if [ -z "$2" ] || dpkg --compare-versions "$2" lt 0.99.7.1-3 then - if ! [ -f /etc/security/opasswd ]; then + if ! [ -f "$DPKG_ROOT/etc/security/opasswd" ]; then umask 066 - touch /etc/security/opasswd + touch "$DPKG_ROOT/etc/security/opasswd" umask 022 fi fi -if dpkg --compare-versions "$2" lt 0.99.9.0-1 && ! [ -f /etc/environment ] +if dpkg --compare-versions "$2" lt 0.99.9.0-1 && ! [ -f "$DPKG_ROOT/etc/environment" ] then - touch /etc/environment + touch "$DPKG_ROOT/etc/environment" fi #DEBHELPER# diff --git a/debian/libpam-runtime.postinst b/debian/libpam-runtime.postinst index b13bf75c..792f44ff 100644 --- a/debian/libpam-runtime.postinst +++ b/debian/libpam-runtime.postinst @@ -20,9 +20,9 @@ then for configfile in common-auth common-account common-session \ common-password do - if [ -f /etc/pam.d/$configfile ] && \ + if [ -f "$DPKG_ROOT/etc/pam.d/$configfile" ] && \ ! fgrep -q $(calculate_md5sum $configfile) \ - /usr/share/pam/$configfile.md5sums 2>/dev/null + "$DPKG_ROOT/usr/share/pam/$configfile.md5sums" 2>/dev/null then force= fi |