summaryrefslogtreecommitdiff
path: root/lib/Vyatta
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2012-08-17 13:07:55 -0700
committerStephen Hemminger <shemminger@vyatta.com>2012-08-17 13:07:55 -0700
commit8d5f6cdd84b95644502eb7115dbca03754549b74 (patch)
tree502f4083a2dd5e8d9a11f7ce183d8d689ebaaf3f /lib/Vyatta
parent8b9f94b547553a2e440b7070c55617050edc2108 (diff)
downloadvyatta-cfg-system-8d5f6cdd84b95644502eb7115dbca03754549b74.tar.gz
vyatta-cfg-system-8d5f6cdd84b95644502eb7115dbca03754549b74.zip
Allow deleting unknown user
Bug 8287 If user doesn't exist in passwd file that is fine.
Diffstat (limited to 'lib/Vyatta')
-rwxr-xr-xlib/Vyatta/Login/User.pm2
1 files changed, 1 insertions, 1 deletions
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");