summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-05-27 13:53:29 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-05-27 13:53:29 -0700
commitc146c4433d10af8a46973b242d48c2aee920dff8 (patch)
tree05117783083e130219c41dc980ff89b71da401d6
parent5296d938dddf85d50d1b61dfb628a74905f778e8 (diff)
downloadvyatta-cfg-quagga-c146c4433d10af8a46973b242d48c2aee920dff8.tar.gz
vyatta-cfg-quagga-c146c4433d10af8a46973b242d48c2aee920dff8.zip
Print error message on failure to create group/user
Bug 4448
-rwxr-xr-xscripts/system/vyatta_update_login.pl6
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";
}
}