summaryrefslogtreecommitdiff
path: root/scripts/system/vyatta_update_login.pl
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 /scripts/system/vyatta_update_login.pl
parent5296d938dddf85d50d1b61dfb628a74905f778e8 (diff)
downloadvyatta-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-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";
}
}