diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-05-27 13:53:29 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-05-27 13:53:29 -0700 |
commit | c146c4433d10af8a46973b242d48c2aee920dff8 (patch) | |
tree | 05117783083e130219c41dc980ff89b71da401d6 /scripts/system/vyatta_update_login.pl | |
parent | 5296d938dddf85d50d1b61dfb628a74905f778e8 (diff) | |
download | vyatta-cfg-system-c146c4433d10af8a46973b242d48c2aee920dff8.tar.gz vyatta-cfg-system-c146c4433d10af8a46973b242d48c2aee920dff8.zip |
Print error message on failure to create group/user
Bug 4448
Diffstat (limited to 'scripts/system/vyatta_update_login.pl')
-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"; } } |