From 0e1030016b93557d9b420c045129b18ddb53e9bb Mon Sep 17 00:00:00 2001 From: natemaia Date: Thu, 5 Nov 2020 12:59:53 -0800 Subject: [PATCH] Move chown for new user home to after creating login files. --- installer | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/installer b/installer index b5d55e1..08a9702 100755 --- a/installer +++ b/installer @@ -6,7 +6,7 @@ # AIF, Calamares, and the Arch Wiki.. Credit where credit is due # shellcheck disable=SC2086,SC2046,SC2254,SC2164 -VER=2.2 +VER=2.3 # default values { @@ -1676,6 +1676,9 @@ install_main() install_user install_login + # make sure the new user owns files in their $HOME + chrun "chown -Rf $NEWUSER:users /home/$NEWUSER" + # changing distro name? if [[ -f "$MNT/etc/os-release" ]] && ! grep -q "$DIST" "$MNT/etc/os-release"; then n=$(awk '/^NAME=/ {gsub(/^NAME=|"|'\''/, ""); print $1}' "$MNT/etc/os-release" 2> /dev/null) @@ -1823,11 +1826,6 @@ install_user() (( i )) && cp -rfaT -b --suffix='.bak' "$MNT/etc/skel/" "$MNT/home/$NEWUSER" install_cleanup "$NEWUSER" - - # make sure the new user owns files in their $HOME - chrun "chown -Rf $NEWUSER:users /home/$NEWUSER" - - return 0 } install_login()