Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archiso/mkarchiso
diff options
context:
space:
mode:
authornl6720 <nl6720@gmail.com>2020-08-30 18:12:08 +0300
committernl6720 <nl6720@gmail.com>2020-09-05 11:23:00 +0300
commit486b1910dd88315dc16d848cfab372eaf07d1641 (patch)
tree2d5f949087b6ba88c85aa16bfef4b728c34bbf19 /archiso/mkarchiso
parent45a5d229b37eedd7996e88e5f7ef7c9a60969e05 (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 .
Diffstat (limited to 'archiso/mkarchiso')
-rwxr-xr-xarchiso/mkarchiso4
1 files changed, 3 insertions, 1 deletions
diff --git a/archiso/mkarchiso b/archiso/mkarchiso
index 6c583a5..c5169f7 100755
--- a/archiso/mkarchiso
+++ b/archiso/mkarchiso
@@ -378,9 +378,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"