summaryrefslogtreecommitdiffstats
path: root/remote/includes/useradd.inc
diff options
context:
space:
mode:
authorSimon Rettberg2014-07-04 14:46:20 +0200
committerSimon Rettberg2014-07-04 14:46:20 +0200
commitd1f5aedd76df437a08f3283fa00bc8a9dab7fa2b (patch)
tree8c046eeaf8e874b479b95964b2bf410365cff438 /remote/includes/useradd.inc
parentremove hardcoded /bin/rm call. Relative calls work in services files (diff)
downloadtm-scripts-d1f5aedd76df437a08f3283fa00bc8a9dab7fa2b.tar.gz
tm-scripts-d1f5aedd76df437a08f3283fa00bc8a9dab7fa2b.tar.xz
tm-scripts-d1f5aedd76df437a08f3283fa00bc8a9dab7fa2b.zip
"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.
Diffstat (limited to 'remote/includes/useradd.inc')
-rw-r--r--remote/includes/useradd.inc4
1 files changed, 2 insertions, 2 deletions
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}"