diff options
author | Jonathan Bauer | 2021-04-06 17:40:02 +0200 |
---|---|---|
committer | Jonathan Bauer | 2021-04-06 17:40:02 +0200 |
commit | dc4776b870413828a5bf5cfa2021611020d8c9f4 (patch) | |
tree | 5574720cf2c4575d8d0ae73885e45747d9c2c4c0 | |
parent | [inc/useradd] do not overwrite USER (diff) | |
download | mltk-dc4776b870413828a5bf5cfa2021611020d8c9f4.tar.gz mltk-dc4776b870413828a5bf5cfa2021611020d8c9f4.tar.xz mltk-dc4776b870413828a5bf5cfa2021611020d8c9f4.zip |
[inc/useradd] make sure dest dir exists for passwd/group/shadow
-rw-r--r-- | core/includes/useradd.inc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/includes/useradd.inc b/core/includes/useradd.inc index b5a7aaf3..47e74e79 100644 --- a/core/includes/useradd.inc +++ b/core/includes/useradd.inc @@ -213,6 +213,7 @@ init_users_and_groups() { local SHADOW="$TARGET_BUILD_DIR/etc/shadow" [ -s "${PASSWD}" -a -s "${GROUP}" -a -s "${SHADOW}" ] && return pinfo "Creating users and groups based on local system...." + mkdir -p "${PASSWD%/*}" || perror "Could not mkdir '${PASSWD%/*}'." cp -a "/etc/passwd" "$PASSWD" || perror "Could not copy /etc/passwd" cp -a "/etc/group" "$GROUP" || perror "Could not copy /etc/group" cp -a "/etc/shadow" "$SHADOW" || perror "Could not copy /etc/shadow" |