summaryrefslogtreecommitdiff
path: root/debian/libnss-mapuser.postinst
diff options
context:
space:
mode:
Diffstat (limited to 'debian/libnss-mapuser.postinst')
-rw-r--r--debian/libnss-mapuser.postinst9
1 files changed, 5 insertions, 4 deletions
diff --git a/debian/libnss-mapuser.postinst b/debian/libnss-mapuser.postinst
index b46e66d..2e9b04f 100644
--- a/debian/libnss-mapuser.postinst
+++ b/debian/libnss-mapuser.postinst
@@ -11,13 +11,14 @@ case "$1" in
# for this package. uid must be first, and mapname must be last
# so uids for mapped users return the mapped name, and on the name,
# we only want to map if no other matches were found
+ # handle case where a comment follows the plugin list
( set +e;
rgroup=radius_users
if [ -e "/etc/nsswitch.conf" ]; then
- sed -i -e '/ mapname/b' \
- -e '/^passwd/s/[ \t][ \t]*/&mapuid /' \
- -e '/^passwd.*#/s/#.*/ mapname &/' \
- -e '/^passwd[^#]*$/s/$/ mapname &/' \
+ sed -i -e '/\smapname/b' \
+ -e '/^passwd:/s/\s\s*/&mapuid /' \
+ -e '/^passwd:.*#/s/#.*/ mapname &/' \
+ -e '/^passwd:[^#]*$/s/$/ mapname &/' \
/etc/nsswitch.conf
fi
addgroup --quiet $rgroup 2>&1 | grep -v 'already exists'