summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnicronNL <kim.sidney@gmail.com>2018-05-17 22:09:09 +0200
committerUnicronNL <kim.sidney@gmail.com>2018-05-17 22:09:09 +0200
commit2392d2acdff02dbf3d04b6a7eb08c195bd3a6168 (patch)
treece8577023ebb23ee17fb8d5dee2d9d29d843b050
parenta300d135962a05f876d25ca57ddead873ab2173e (diff)
downloadlibnss-mapuser-2392d2acdff02dbf3d04b6a7eb08c195bd3a6168.tar.gz
libnss-mapuser-2392d2acdff02dbf3d04b6a7eb08c195bd3a6168.zip
Create users from vyatta-cfg-system package and update nnswitch in config
-rw-r--r--debian/libnss-mapuser.postinst44
-rw-r--r--debian/libnss-mapuser.prerm7
-rw-r--r--nss_mapuser.conf2
3 files changed, 1 insertions, 52 deletions
diff --git a/debian/libnss-mapuser.postinst b/debian/libnss-mapuser.postinst
index 54c661b..3220f99 100644
--- a/debian/libnss-mapuser.postinst
+++ b/debian/libnss-mapuser.postinst
@@ -5,50 +5,6 @@
set -e
-case "$1" in
- configure)
- # Add mapname and user to /etc/nsswitch.conf, since it's necessary
- # 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 '/\smapname/b' \
- -e '/^passwd:/s/\s\s*/&mapuid /' \
- -e '/^passwd:.*#/s/#.*/ mapname &/' \
- -e '/^passwd:[^#]*$/s/$/ mapname &/' \
- -e '/^group:.*#/s/#.*/ mapname &/' \
- -e '/^group:[^#]*$/s/: */& mapname /' \
- /etc/nsswitch.conf
- fi
- addgroup --quiet $rgroup 2>&1 | grep -v 'already exists'
- ourshell=/bin/bash # not radius_shell, has pkg ordering issues.
- adduser --quiet --firstuid 1000 --disabled-login --ingroup $rgroup \
- --gecos "radius user" --shell $ourshell radius_user 2>&1 |
- grep -v 'already exists'
- adduser --quiet --firstuid 1000 --disabled-login --ingroup $rgroup \
- --gecos "radius privileged user" --shell $ourshell radius_priv_user 2>&1 |
- grep -v 'already exists'
- # regular radius logins can run net show commands
- adduser --quiet radius_user netshow
- # privileged radius logins can run net config commands, as well as show
- adduser --quiet radius_priv_user netedit
- adduser --quiet radius_priv_user sudo
- exit 0
- )
- ;;
-
- abort-upgrade|abort-remove|abort-deconfigure)
- ;;
-
- *)
- echo "postinst called with unknown argument \`$1'" >&2
- exit 1
- ;;
-esac
-
# needed for install, upgrade, remove, and purge, including aborts
pam-auth-update --package
diff --git a/debian/libnss-mapuser.prerm b/debian/libnss-mapuser.prerm
index c4f259f..c9bb6b1 100644
--- a/debian/libnss-mapuser.prerm
+++ b/debian/libnss-mapuser.prerm
@@ -4,13 +4,6 @@ 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#
diff --git a/nss_mapuser.conf b/nss_mapuser.conf
index 1ed70d1..dda0baa 100644
--- a/nss_mapuser.conf
+++ b/nss_mapuser.conf
@@ -17,7 +17,7 @@
# Cumulus Linux ships with it set to 1001, so we never lookup system
# users, or the standard "cumulus" account. You may want to change this
# to the value of the radius_user account.
-min_uid=1001
+#min_uid=1001
# This is a comma separated list of usernames that are never mapped
# because they are standard accounts. They cause an early not found