summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Langasek <vorlon@debian.org>2009-08-18 13:36:50 -0700
committerSteve Langasek <vorlon@debian.org>2019-01-08 19:42:00 -0800
commit03366a83da725a33328e4f73e11960a9fa0ee508 (patch)
treef34ed7197c7b644c5f2b7a6661e2dbc7734e9194
parent0ef67bccf779c2bcc3bbc7e69645f1f2b12981a0 (diff)
debian/libpam-runtime.postinst: bump the --force version check to
1.0.1-11, to allow for a new common-session-noninteractive config file; and include md5sum checking logic that will work the same with old unmanaged and new managed /etc/pam.d/common-* files.
-rw-r--r--debian/changelog9
-rw-r--r--debian/libpam-runtime.postinst13
2 files changed, 20 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index 2f2a8f43..753db05d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+pam (1.0.1-11) UNRELEASED; urgency=low
+
+ * debian/libpam-runtime.postinst: bump the --force version check to
+ 1.0.1-11, to allow for a new common-session-noninteractive config file;
+ and include md5sum checking logic that will work the same with old
+ unmanaged and new managed /etc/pam.d/common-* files.
+
+ -- Steve Langasek <vorlon@debian.org> Tue, 18 Aug 2009 12:58:52 -0700
+
pam (1.0.1-10) unstable; urgency=high
[ Steve Langasek ]
diff --git a/debian/libpam-runtime.postinst b/debian/libpam-runtime.postinst
index 31206c57..dbda6895 100644
--- a/debian/libpam-runtime.postinst
+++ b/debian/libpam-runtime.postinst
@@ -13,17 +13,26 @@ if [ "x$2" != "x" ] ;then
fi
fi
+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' \
+ /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-6
+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 /etc/pam.d/$configfile ] && \
- ! fgrep -q `md5sum /etc/pam.d/$configfile` \
+ ! fgrep -q $(calculate_md5sum $configfile) \
/usr/share/pam/$configfile.md5sums 2>/dev/null
then
force=