From d1f5aedd76df437a08f3283fa00bc8a9dab7fa2b Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 4 Jul 2014 14:46:20 +0200 Subject: "Fedora Support", step 1 -> Several changes: 1) Make sure /bin /sbin /lib and /lib64 are ALWAYS symlinks to /usr/XXX, no matter what the current distribution does. 2) Make sure nobody and nogroup exist. 3) Fix various modules making assumptions that are not true on every distro. 4) Add symlinks to kdm module since fedora is looking for kdmrc in yet another spot. 5) Add detection of fedora, support its package manager What still breaks: dnbd3 Other distros might not work now, they need adaption to changed logic in some modules. --- remote/includes/useradd.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'remote/includes/useradd.inc') diff --git a/remote/includes/useradd.inc b/remote/includes/useradd.inc index 352da606..29a9c39a 100644 --- a/remote/includes/useradd.inc +++ b/remote/includes/useradd.inc @@ -16,7 +16,7 @@ . "${ROOT_DIR}/helper/string.inc" -NAME_REGEX='^[a-z][-a-z0-9]*$' +declare -r NAME_REGEX='^[a-z][-a-z0-9]*$' # Generate a UID for a given USERNAME. Return existing UID if possible, generate new one otherwise generate_uid() @@ -150,7 +150,7 @@ add_user() { pinfo "Created user $USER" elif [ "$PASSWORD" != "*" ]; then # update user's password - sed -i -r "s#^${USER}:[^:]*:(.*)\$#${USER}:${PASSWORD}:\1#g" "${_SHADOW}" + sed -i -r "s#^${USER}:[^:]*:(.*)\$"'#'"${USER}:${PASSWORD}:\1#g" "${_SHADOW}" pinfo "Updated password of $USER" fi [ -z "${_GID}" ] && pinfo "Created group $GROUP" && echo "${GROUP}:x:${GROUPID}:" >> "${_GROUP}" -- cgit v1.2.3-55-g7522