From 4ccd75456c8dea7ea9cd8cdf1469a544c7d8f12e Mon Sep 17 00:00:00 2001 From: Michael 'v4hn' Goerner Date: Sun, 3 Nov 2013 02:17:17 +0100 Subject: [PATCH] check return value of actual *add commands --- libs/useradd.lunar | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/useradd.lunar b/libs/useradd.lunar index 0ac401846..c4a443fce 100644 --- a/libs/useradd.lunar +++ b/libs/useradd.lunar @@ -47,7 +47,9 @@ function add_priv_group() { exit 1 fi verbose_msg "creating group \"$GROUPNAME\" with id=\"$N\"" - groupadd -g $N $GROUPNAME + if ! groupadd -g $N $GROUPNAME ; then + return 1 + fi fi if [ -n "$INSTALLWATCHFILE" ] ; then @@ -104,7 +106,9 @@ function add_priv_user() { shift verbose_msg "creating user \"$USERNAME\" (opts=\"-u $N -g $GROUPNAME $@\")" - useradd -u $N -g $GROUPNAME $USERNAME $@ + if ! useradd -u $N -g $GROUPNAME $USERNAME $@ ; then + return 1 + fi fi