diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/system/vyatta_update_login.pl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/system/vyatta_update_login.pl b/scripts/system/vyatta_update_login.pl index d482c297..c8d0a23a 100755 --- a/scripts/system/vyatta_update_login.pl +++ b/scripts/system/vyatta_update_login.pl @@ -120,8 +120,10 @@ for my $user (@user_keys) { $cmd .= " -c \"$fname\"" if ( defined $fname ); $cmd .= " -d \"$home\"" if ( defined $home ); $cmd .= ' -G ' . join( ',', @groups ); - system("sudo $cmd $user") == 0 - or die "sudo $cmd $user failed: $?"; + system("sudo $cmd $user"); + return if ($? == 0); + my $reason = $reasons{($? >> 8)}; + die "Attempt to change user $user failed: $reason\n"; } } |