diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-12-09 14:51:15 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-12-09 14:51:15 -0800 |
commit | 59c50771a80bd57b9f0c82505799909b022d3023 (patch) | |
tree | 8b27d88f1e314dbc1e418c92d364c87084e79b19 /lib | |
parent | 72fec3c90503e8c92036df22b3fac66c5938eb34 (diff) | |
download | vyatta-cfg-system-59c50771a80bd57b9f0c82505799909b022d3023.tar.gz vyatta-cfg-system-59c50771a80bd57b9f0c82505799909b022d3023.zip |
Redefine meaning of protected-user
A entry in protected-user means that the Vyatta config system should
just leave it alone. This is intended for root, and other special
accounts.
Original code didn't work during admin anyway because of missing
sudo.
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/Vyatta/Login/User.pm | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/Vyatta/Login/User.pm b/lib/Vyatta/Login/User.pm index b03b90b7..5280a4a1 100755 --- a/lib/Vyatta/Login/User.pm +++ b/lib/Vyatta/Login/User.pm @@ -248,15 +248,12 @@ sub update { # This can happen if user added but configuration not saved my %protected = map { $_ => 1 } _protected_users(); foreach my $user (_vyatta_users()) { - if ($protected{$user}) { - warn "User $user should not being using vbash - fixed\n"; - system ("usermod -s /bin/bash $user") == 0 - or die "Attempt to modify user $user shell failed: $!"; - } elsif (! defined $users{$user}) { - warn "User $user not listed in current configuration\n"; - system ("userdel --remove $user") == 0 - or die "Attempt to delete user $user failed: $!"; - } + next if $protected{$user}; + next if defined $users{$user}; + + warn "User $user not listed in current configuration\n"; + system ("sudo userdel --remove $user") == 0 + or die "Attempt to delete user $user failed: $!"; } } |