diff options
-rw-r--r-- | core/includes/useradd.inc | 8 | ||||
-rw-r--r-- | core/modules/dnbd3-proxy-mode/module.build | 3 |
2 files changed, 6 insertions, 5 deletions
diff --git a/core/includes/useradd.inc b/core/includes/useradd.inc index d47b43b9..348c5ecd 100644 --- a/core/includes/useradd.inc +++ b/core/includes/useradd.inc @@ -102,8 +102,9 @@ useradd () { [ "$pw" != "#" ] && usr_setpw "$name" "$pw" return 0 # Nothing to do fi - command useradd "${_USER_EXTRA_OPTS[@]}" "${opts[@]}" || perror "useradd failed" + command useradd "${_USER_EXTRA_OPTS[@]}" "${opts[@]}" || perror "useradd ${opts[*]} failed" [ "$pw" != "#" ] && usr_setpw "$name" "$pw" + true } groupadd () { @@ -135,7 +136,8 @@ groupadd () { (( sys == 0 && _ngid < 1000 )) && perror "$name: Already exists with system id $_ngid" return 0 fi - command groupadd "${_USER_EXTRA_OPTS[@]}" "${opts[@]}" || perror "groupadd failed" + command groupadd "${_USER_EXTRA_OPTS[@]}" "${opts[@]}" || perror "groupadd ${opts[*]} failed" + true } # Add user to given group. Not entirely safe as we don't wait for a lock, @@ -144,7 +146,7 @@ groupadd () { add_to_group () { ua_set_vars grep -qP "^${2}:.*:.*[:,]${1}(,|$)" "$_GROUP" && return 0 - grep -q "^${2}:" "$_GROUP" || return 1 + grep -q "^${2}:" "$_GROUP" || perror "Cannot add '$1' to '$2' - no such group" sed -i -r "s/^${2}:[^:]*:[^:]*:.+$/&,$1/;s/^${2}:[^:]*:[^:]*:$/&$1/" "$_GROUP" } diff --git a/core/modules/dnbd3-proxy-mode/module.build b/core/modules/dnbd3-proxy-mode/module.build index 6027ceeb..9a920069 100644 --- a/core/modules/dnbd3-proxy-mode/module.build +++ b/core/modules/dnbd3-proxy-mode/module.build @@ -8,6 +8,5 @@ build() { } post_copy() { - useradd --system --user-group --no-create-home --groups "fuse" "dnbd3" \ - || perror "Cannot create user dnbd3 with supp. group fuse" + useradd --system --user-group --no-create-home --groups "fuse" "dnbd3" } |