diff options
author | nl6720 <nl6720@gmail.com> | 2020-08-30 18:12:08 +0300 |
---|---|---|
committer | David P <megver83@parabola.nu> | 2020-09-27 16:20:54 -0300 |
commit | 8cbac065d0bb3214d808b8cb77ad149b3387d6c8 (patch) | |
tree | 0fdaed8b2408960ec57b7eb605c291f31fd84339 | |
parent | 052cc9ce62effc84461837200927fd1a5f913d40 (diff) |
Do not overwrite existing files when copying from /etc/skel/
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 .
-rwxr-xr-x | parabolaiso/mkparabolaiso | 4 |
1 files changed, 3 insertions, 1 deletions
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" |