From 8d5f6cdd84b95644502eb7115dbca03754549b74 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 17 Aug 2012 13:07:55 -0700 Subject: Allow deleting unknown user Bug 8287 If user doesn't exist in passwd file that is fine. --- lib/Vyatta/Login/User.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/Vyatta') diff --git a/lib/Vyatta/Login/User.pm b/lib/Vyatta/Login/User.pm index fa0cca7d..411aed6c 100755 --- a/lib/Vyatta/Login/User.pm +++ b/lib/Vyatta/Login/User.pm @@ -111,7 +111,7 @@ sub _delete_user { or die "usermod of root failed: $?\n"; } elsif ( defined($login) && $login eq $user ) { die "Attempting to delete current user: $user\n"; - } else { + } elsif ( getpwnam($user) ) { if (`who | grep "^$user"` ne '') { warn "$user is logged in, forcing logout\n"; system("pkill -HUP -u $user"); -- cgit v1.2.3