From f4b22a2f215f6f80558d9e4075c9de306c8b9953 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 16:22:53 +0200 Subject: Adding debian version 1.5.2-6+deb12u1. Signed-off-by: Daniel Baumann --- debian/libpam-runtime.postinst | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 debian/libpam-runtime.postinst (limited to 'debian/libpam-runtime.postinst') diff --git a/debian/libpam-runtime.postinst b/debian/libpam-runtime.postinst new file mode 100644 index 0000000..667b33a --- /dev/null +++ b/debian/libpam-runtime.postinst @@ -0,0 +1,41 @@ +#!/bin/sh -e + +. /usr/share/debconf/confmodule + +calculate_md5sum() +{ + configfile="$1" + sed -n -e'1,/# here are the per-package modules (the "Primary" block)/p; + /# here.s the fallback if no module succeeds/,/# and here are more per-package modules (the "Additional" block)/p; + /# end of pam-auth-update config/,$p' \ + "$DPKG_ROOT"/etc/pam.d/"$configfile" | md5sum | awk '{ print $1 }' +} + +# If the user has removed the config file, respect this sign of dementia +# -- only create on package install. +force= +if [ -z "$2" ] || dpkg --compare-versions "$2" lt 1.0.1-11 +then + force=--force + for configfile in common-auth common-account common-session \ + common-password + do + if [ -f "$DPKG_ROOT"/etc/pam.d/$configfile ] && \ + ! fgrep -q $(calculate_md5sum $configfile) \ + "$DPKG_ROOT"/usr/share/pam/$configfile.md5sums 2>/dev/null + then + force= + fi + done +fi + +pam-auth-update --root "$DPKG_ROOT" --package $force + +if [ -n "$force" ]; then + rm -f "$DPKG_ROOT"/etc/pam.d/common-auth.pam-old \ + "$DPKG_ROOT"/etc/pam.d/common-account.pam-old \ + "$DPKG_ROOT"/etc/pam.d/common-password.pam-old \ + "$DPKG_ROOT"/etc/pam.d/common-session.pam-old +fi + +#DEBHELPER# -- cgit v1.2.3