From 8d34cf49ad72e556b88033202f7dde130d80fa74 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 25 Feb 2013 20:13:48 +0100 Subject: Several fixes and improvements: - return uid and gid again for add_user and add_group - abort execution if sourcing the .build or .conf file of a module fails - make sure lightdm user and group exists when building the ldm module - use tarcopy in all modules if appropriate --- helper/useradd.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'helper') diff --git a/helper/useradd.inc b/helper/useradd.inc index 798e997c..bcbb25b2 100644 --- a/helper/useradd.inc +++ b/helper/useradd.inc @@ -149,6 +149,7 @@ add_user() { pinfo "Updated password of $USER" fi [ -z "${_GID}" ] && pinfo "Created group $GROUP" && echo "${GROUP}:x:${GROUPID}:" >> "${_GROUP}" + echo "${USERID}" } add_group () { @@ -166,7 +167,7 @@ add_group () { fi [ $# -ge 2 ] && [ ! -z "$2" ] && GROUPID=$2 local _GID=$(grep -E "^${GROUP}:[^:]*:[0-9]+:" "${_GROUP}" | head -1 | awk -F ':' '{print $3}') - [ "x${_GID}" != "x" ] && [ "x$GROUPID" = "x-" -o "x$GROUPID" = "x${_GID}" ] && return # nothing to do, already exists + [ "x${_GID}" != "x" ] && [ "x$GROUPID" = "x-" -o "x$GROUPID" = "x${_GID}" ] && echo "${_GID}" && return # nothing to do, already exists [ "x${_GID}" != "x" ] && perror "Group $GROUP already exists with GID ${_GID}, but creation was requested with GID $GROUPID" if [ "x$GROUPID" = "x-" ]; then local _UID=$(grep -E "^${GROUP}:[^:]*:[0-9]+:" "${_PASSWD}" | head -1 | awk -F ':' '{print $3}') @@ -178,6 +179,7 @@ add_group () { fi echo "${GROUP}:x:${GROUPID}:" >> "${_GROUP}" pinfo "Created group $GROUP" + echo "${GROUPID}" } init_users_and_groups() { -- cgit v1.2.3-55-g7522