From 59c50771a80bd57b9f0c82505799909b022d3023 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 9 Dec 2009 14:51:15 -0800 Subject: 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. --- lib/Vyatta/Login/User.pm | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'lib') 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: $!"; } } -- cgit v1.2.3