summaryrefslogtreecommitdiff
path: root/debian/vyos-libnss-mapuser.prerm
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2025-04-13 15:31:48 +0100
committerGitHub <noreply@github.com>2025-04-13 15:31:48 +0100
commit93195672035a655bbcfd9828abd69dae679d84c1 (patch)
treea86fb29d871f19e17b543b8fd14d7cb3d7e7df71 /debian/vyos-libnss-mapuser.prerm
parent5f734fc9e65e2c3de112d1d2be7b3ef94de0095d (diff)
parent02acf3932501e4ca775787bf0c86ef97a50c986d (diff)
downloadlibnss-mapuser-current.tar.gz
libnss-mapuser-current.zip
Merge pull request #9 from dmbaturin/T7336-install-fixHEADcurrent
packaging: T7336: fix package install files
Diffstat (limited to 'debian/vyos-libnss-mapuser.prerm')
-rw-r--r--debian/vyos-libnss-mapuser.prerm16
1 files changed, 16 insertions, 0 deletions
diff --git a/debian/vyos-libnss-mapuser.prerm b/debian/vyos-libnss-mapuser.prerm
new file mode 100644
index 0000000..c4f259f
--- /dev/null
+++ b/debian/vyos-libnss-mapuser.prerm
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = remove ]; then
+ pam-auth-update --package --remove mapuser
+ # Undo the addition of the plugins
+ if [ -e "/etc/nsswitch.conf" ]; then
+ sed -i -e '/^passwd:.*mapuid[ \t]/s/mapuid[ \t]//' \
+ -e '/^passwd:.*[ \t]mapname/s/[ \t]mapname//' \
+ -e '/^group:.*[ \t]mapname/s/[ \t]mapname//' \
+ /etc/nsswitch.conf || true # don't prevent remove on error
+ fi
+fi
+
+#DEBHELPER#