summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnicronNL <kim.sidney@gmail.com>2018-05-16 22:22:59 +0200
committerUnicronNL <kim.sidney@gmail.com>2018-05-16 22:22:59 +0200
commit2dfccfb76f04c03100e9552e98c0fe899818071d (patch)
tree91e1b01db15910b36406033ac41d4256112e5dbe
parentc78617e83f502b0983eac764ca49a8a934220af8 (diff)
downloadvyatta-cfg-system-2dfccfb76f04c03100e9552e98c0fe899818071d.tar.gz
vyatta-cfg-system-2dfccfb76f04c03100e9552e98c0fe899818071d.zip
Add 2 users used for radius mapping.
-rwxr-xr-xdebian/vyatta-cfg-system.postinst.in23
-rwxr-xr-xlib/Vyatta/Login/User.pm3
2 files changed, 26 insertions, 0 deletions
diff --git a/debian/vyatta-cfg-system.postinst.in b/debian/vyatta-cfg-system.postinst.in
index 9850f077..2c32a91f 100755
--- a/debian/vyatta-cfg-system.postinst.in
+++ b/debian/vyatta-cfg-system.postinst.in
@@ -219,6 +219,29 @@ update-rc.d vyos-intfwatchd start 2345
# set ec2-vyos-init to start on boot
update-rc.d ec2-vyos-init start 2345
+# Add radius operator user for radius users to map to
+if ! grep -q '^radius_user' /etc/passwd; then
+ adduser --quiet --firstuid 1000 --disabled-login --ingroup users --gecos "radius user" --shell /bin/vbash radius_user
+ adduser --quiet radius_user quaggavty
+ adduser --quiet radius_user vyattaop
+ adduser --quiet radius_user operator
+ adduser --quiet radius_user adm
+ adduser --quiet radius_user dip
+ adduser --quiet radius_user users
+fi
+
+# Add radius admin user for radius users to map to
+if ! grep -q '^radius_priv_user' /etc/passwd; then
+ adduser --quiet --firstuid 1000 --disabled-login --ingroup vyattacfg --gecos "radius privileged user" --shell /bin/vbash radius_priv_user
+ adduser --quiet radius_user quaggavty
+ adduser --quiet radius_user vyattacfg
+ adduser --quiet radius_user sudo
+ adduser --quiet radius_user adm
+ adduser --quiet radius_user dip
+ adduser --quiet radius_user disk
+ adduser --quiet radius_user users
+fi
+
# Local Variables:
# mode: shell-script
# sh-indentation: 4
diff --git a/lib/Vyatta/Login/User.pm b/lib/Vyatta/Login/User.pm
index e03888cd..e0305fbb 100755
--- a/lib/Vyatta/Login/User.pm
+++ b/lib/Vyatta/Login/User.pm
@@ -231,6 +231,9 @@ sub update {
# This can happen if user added but configuration not saved
# and system is rebooted
foreach my $user ( _local_users() ) {
+ # skip radius users
+ next if $user eq 'radius_user';
+ next if $user eq 'radius_priv_user';
# did we see this user in configuration?
next if defined $users{$user};