summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnicronNL <kim.sidney@gmail.com>2018-05-17 20:53:42 +0200
committerUnicronNL <kim.sidney@gmail.com>2018-05-17 20:53:42 +0200
commit881da62cd36e0f499fa8dda165feb4f94e71a3c5 (patch)
tree26b1d4ab5ebc9e603db3da7c992c614d87f62f01
parent540269c58ea647a4695a78b79714f61a2d1b80db (diff)
downloadvyatta-cfg-system-881da62cd36e0f499fa8dda165feb4f94e71a3c5.tar.gz
vyatta-cfg-system-881da62cd36e0f499fa8dda165feb4f94e71a3c5.zip
Radius update nsswitch.conf
-rw-r--r--lib/Vyatta/Login/RadiusServer.pm19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/Vyatta/Login/RadiusServer.pm b/lib/Vyatta/Login/RadiusServer.pm
index 275f9e47..9eec4aa3 100644
--- a/lib/Vyatta/Login/RadiusServer.pm
+++ b/lib/Vyatta/Login/RadiusServer.pm
@@ -29,8 +29,14 @@ my $PAM_RAD_AUTH = "/usr/share/pam-configs/radius";
my $PAM_RAD_SYSCONF = "/opt/vyatta/etc/pam_radius.cfg";
sub remove_pam_radius {
+ qx'sed -i -e \'/^passwd:.*mapuid[ \t]/s/mapuid[ \t]//\' \
+ -e \'/^passwd:.*[ \t]mapname/s/[ \t]mapname//\' \
+ -e \'/^group:.*[ \t]mapname/s/[ \t]mapname//\' \
+ -e \'s/[ \t]*$//\' \
+ /etc/nsswitch.conf';
+
system("DEBIAN_FRONTEND=noninteractive " .
- " pam-auth-update --package --remove radius") == 0
+ "pam-auth-update --package --remove radius") == 0
or die "pam-auth-update remove failed";
unlink($PAM_RAD_AUTH)
@@ -43,7 +49,16 @@ sub add_pam_radius {
system("DEBIAN_FRONTEND=noninteractive " .
"pam-auth-update --package radius") == 0
- or die "pam-auth-update add failed"
+ or die "pam-auth-update add failed";
+
+ qx'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' == 0
+ or die "NSS configuration failed";
}
sub update {