From 8cbac065d0bb3214d808b8cb77ad149b3387d6c8 Mon Sep 17 00:00:00 2001 From: nl6720 Date: Sun, 30 Aug 2020 18:12:08 +0300 Subject: Do not overwrite existing files when copying from /etc/skel/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Copy /etc/skel/ only for users with UID in range 1000–60000. Correct user home directory permission after copying files. Fixes all /etc/skel issues from https://bugs.archlinux.org/task/67729 . --- parabolaiso/mkparabolaiso | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parabolaiso/mkparabolaiso b/parabolaiso/mkparabolaiso index 6ee769a..5c294e9 100755 --- a/parabolaiso/mkparabolaiso +++ b/parabolaiso/mkparabolaiso @@ -384,9 +384,11 @@ _make_customize_airootfs() { if [[ -e "${profile}/airootfs/etc/passwd" ]]; then _msg_info "Copying /etc/skel/* to user homes..." while IFS=':' read -a passwd -r; do + (( passwd[2] >= 1000 && passwd[2] < 60000 )) || continue [[ "${passwd[5]}" == '/' ]] && continue [[ -z "${passwd[5]}" ]] && continue - cp -RdT --preserve=mode,timestamps,links -- "${airootfs_dir}/etc/skel" "${airootfs_dir}${passwd[5]}" + cp -dnRT --preserve=mode,timestamps,links -- "${airootfs_dir}/etc/skel" "${airootfs_dir}${passwd[5]}" + chmod -f 0750 -- "${airootfs_dir}${passwd[5]}" chown -hR -- "${passwd[2]}:${passwd[3]}" "${airootfs_dir}${passwd[5]}" done < "${profile}/airootfs/etc/passwd" -- cgit v1.2.2