summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2021-04-06 16:49:31 +0200
committerJonathan Bauer2021-04-06 16:49:31 +0200
commit36f58ae7c058b015b50dff532421cbe6357435cc (patch)
tree8b7cb250627e8cad4241994aa156472c19223d63
parent[inc/useradd] add -m if USERHOME is set (diff)
downloadmltk-36f58ae7c058b015b50dff532421cbe6357435cc.tar.gz
mltk-36f58ae7c058b015b50dff532421cbe6357435cc.tar.xz
mltk-36f58ae7c058b015b50dff532421cbe6357435cc.zip
[inc/useradd] quote things
-rw-r--r--core/includes/useradd.inc16
1 files changed, 8 insertions, 8 deletions
diff --git a/core/includes/useradd.inc b/core/includes/useradd.inc
index af7260de..011ab184 100644
--- a/core/includes/useradd.inc
+++ b/core/includes/useradd.inc
@@ -103,9 +103,9 @@ add_user() {
declare -a _USERADD_OPTS
if [ "$REMOTE_LOCAL_INSTALL" -eq 0 ]; then
# regular mltk mode, copy the current user-related files to TARGET_BUILD_DIR
- local _PASSWD=${TARGET_BUILD_DIR}/etc/passwd
- local _GROUP=${TARGET_BUILD_DIR}/etc/group
- local _SHADOW=${TARGET_BUILD_DIR}/etc/shadow
+ local _PASSWD="${TARGET_BUILD_DIR}/etc/passwd"
+ local _GROUP="${TARGET_BUILD_DIR}/etc/group"
+ local _SHADOW="${TARGET_BUILD_DIR}/etc/shadow"
init_users_and_groups
[ ! -f "${_PASSWD}" ] && perror "add_user: password file does not exist in target system. (build base first)"
[ ! -f "${_GROUP}" ] && perror "add_user: group file does not exist in target system. (build base first)"
@@ -114,13 +114,13 @@ add_user() {
# also add the --root options
_USERADD_OPTS+=("--root" "$TARGET_BUILD_DIR")
else
- local _PASSWD=/etc/passwd
- local _GROUP=/etc/group
- local _SHADOW=/etc/shadow
+ local _PASSWD="/etc/passwd"
+ local _GROUP="/etc/group"
+ local _SHADOW="/etc/shadow"
fi
if [ "x$1" != "x" ]; then
- local USER=$1
+ local USER="$1"
local GROUP=""
local USERID=""
local GROUPID=""
@@ -140,7 +140,7 @@ add_user() {
if [ -z "$GROUP" ]; then
[ -z "$GROUPID" ] && local GROUPID=$(get_gid_for_user "${USER}")
[ -n "$GROUPID" ] && local GROUP=$(get_group_for_gid "${GROUPID}")
- [ -z "$GROUP" ] && local GROUP=$USER
+ [ -z "$GROUP" ] && local GROUP="$USER"
fi
if [ -n "$GROUP" ]; then