Fix: broken password separators

This commit is contained in:
natemaia 2019-01-18 23:09:38 -08:00
parent 5d3ef48ac7
commit fb99fbe371

View File

@ -8,7 +8,7 @@
# Some ideas and code has been taken from other installers # Some ideas and code has been taken from other installers
# AIF, Cnichi, Calamares, The Arch Wiki.. Credit where credit is due # AIF, Cnichi, Calamares, The Arch Wiki.. Credit where credit is due
VER="1.8.38" # version VER="1.8.39" # version
DIST="ArchLabs" # distributor DIST="ArchLabs" # distributor
MNT="/mnt" # install mountpoint MNT="/mnt" # install mountpoint
@ -345,7 +345,7 @@ mkuser()
{ {
tput cnorm tput cnorm
local values local values
if ! values="$(dialog --stdout --no-cancel --separator ':|~|:' \ if ! values="$(dialog --stdout --no-cancel --separator ';:~:;' \
--ok-label "Submit" --backtitle "$BT" --title " $_UserTitle " \ --ok-label "Submit" --backtitle "$BT" --title " $_UserTitle " \
--insecure --mixedform "$_UserBody" 0 0 0 \ --insecure --mixedform "$_UserBody" 0 0 0 \
"$_Username" 1 1 "$NEWUSER" 1 $((${#_Username} + 2)) $COLUMNS 0 0 \ "$_Username" 1 1 "$NEWUSER" 1 $((${#_Username} + 2)) $COLUMNS 0 0 \
@ -358,11 +358,11 @@ mkuser()
fi fi
local user pass pass2 rpass rpass2 local user pass pass2 rpass rpass2
user="$(awk -F':|~|:' '{print $1}' <<< "$values")" user="$(awk -F';:~:;' '{print $1}' <<< "$values")"
pass="$(awk -F':|~|:' '{print $2}' <<< "$values")" pass="$(awk -F';:~:;' '{print $2}' <<< "$values")"
pass2="$(awk -F':|~|:' '{print $3}' <<< "$values")" pass2="$(awk -F';:~:;' '{print $3}' <<< "$values")"
rpass="$(awk -F':|~|:' '{print $5}' <<< "$values")" rpass="$(awk -F';:~:;' '{print $5}' <<< "$values")"
rpass2="$(awk -F':|~|:' '{print $6}' <<< "$values")" rpass2="$(awk -F';:~:;' '{print $6}' <<< "$values")"
# both root passwords are empty, so use the user passwords instead # both root passwords are empty, so use the user passwords instead
[[ $rpass == "" && $rpass2 == "" ]] && { rpass="$pass"; rpass2="$pass2"; } [[ $rpass == "" && $rpass2 == "" ]] && { rpass="$pass"; rpass2="$pass2"; }
@ -1493,11 +1493,9 @@ create_user()
{ {
printf "Creating user $NEWUSER, setting passwords, and setting shell\n" printf "Creating user $NEWUSER, setting passwords, and setting shell\n"
chrun "chpasswd <<< 'root:$ROOT_PASS'" 2>$ERR chrun "chpasswd <<< 'root:$ROOT_PASS'"
errshow 1 "Setting root password"
if [[ $MYSHELL != *zsh ]]; then if [[ $MYSHELL != *zsh ]]; then
chrun "usermod -s $MYSHELL root" 2>$ERR chrun "usermod -s $MYSHELL root"
errshow 1 "Setting root shell"
if [[ $MYSHELL == "/usr/bin/mksh" ]]; then if [[ $MYSHELL == "/usr/bin/mksh" ]]; then
cp -fv $MNT/etc/skel/.mkshrc /root/.mkshrc cp -fv $MNT/etc/skel/.mkshrc /root/.mkshrc
fi fi
@ -1505,10 +1503,8 @@ create_user()
local groups='audio,autologin,floppy,log,network,rfkill,scanner,storage,optical,power,wheel' local groups='audio,autologin,floppy,log,network,rfkill,scanner,storage,optical,power,wheel'
chrun "groupadd -r autologin" chrun "groupadd -r autologin"
chrun "useradd -m -u 1000 -g users -G $groups -s $MYSHELL $NEWUSER" 2>$ERR chrun "useradd -m -u 1000 -g users -G $groups -s $MYSHELL $NEWUSER"
errshow 1 "useradd -m -u 1000 -g users -G $groups -s $MYSHELL $NEWUSER" chrun "chpasswd <<< '$NEWUSER:$USER_PASS'"
chrun "chpasswd <<< '$NEWUSER:$USER_PASS'" 2>$ERR
errshow 1 "Setting new users password"
if [[ $USER_PKGS == *neovim* ]]; then if [[ $USER_PKGS == *neovim* ]]; then
mkdir -p $MNT/home/$NEWUSER/.config/nvim mkdir -p $MNT/home/$NEWUSER/.config/nvim
@ -2209,17 +2205,17 @@ luks_pass()
tput cnorm tput cnorm
local values local values
if [[ $name == "" ]]; then if [[ $name == "" ]]; then
if ! values="$(dialog --stdout --no-cancel --separator ':|~|:' \ if ! values="$(dialog --stdout --no-cancel --separator ';:~:;' \
--ok-label "Submit" --backtitle "$BT" --title " $title " --insecure --mixedform \ --ok-label "Submit" --backtitle "$BT" --title " $title " --insecure --mixedform \
"\nEnter the password to decrypt $ROOT_PART.\n\nThis is needed to create a keyfile." 0 0 0 \ "\nEnter the password to decrypt $ROOT_PART.\n\nThis is needed to create a keyfile." 0 0 0 \
"$_Password" 1 1 "" 1 $((${#_Password} + 2)) $COLUMNS 0 1 \ "$_Password" 1 1 "" 1 $((${#_Password} + 2)) $COLUMNS 0 1 \
"$_Password2" 2 1 "" 2 $((${#_Password2} + 2)) $COLUMNS 0 1)"; then "$_Password2" 2 1 "" 2 $((${#_Password2} + 2)) $COLUMNS 0 1)"; then
return 1 return 1
fi fi
pass="$(awk -F':|~|:' '{print $1}' <<< "$values")" pass="$(awk -F';:~:;' '{print $1}' <<< "$values")"
pass2="$(awk -F':|~|:' '{print $2}' <<< "$values")" pass2="$(awk -F';:~:;' '{print $2}' <<< "$values")"
else else
if ! values="$(dialog --stdout --no-cancel --separator ':|~|:' \ if ! values="$(dialog --stdout --no-cancel --separator ';:~:;' \
--ok-label "Submit" --backtitle "$BT" --title " $title " \ --ok-label "Submit" --backtitle "$BT" --title " $title " \
--insecure --mixedform "$_LuksOpenBody" 0 0 0 \ --insecure --mixedform "$_LuksOpenBody" 0 0 0 \
"$_Name" 1 1 "$name" 1 $((${#_Name} + 2)) $COLUMNS 0 0 \ "$_Name" 1 1 "$name" 1 $((${#_Name} + 2)) $COLUMNS 0 0 \
@ -2227,9 +2223,9 @@ luks_pass()
"$_Password2" 3 1 "" 3 $((${#_Password2} + 2)) $COLUMNS 0 1)"; then "$_Password2" 3 1 "" 3 $((${#_Password2} + 2)) $COLUMNS 0 1)"; then
return 1 return 1
fi fi
name="$(awk -F':|~|:' '{print $1}' <<< "$values")" name="$(awk -F';:~:;' '{print $1}' <<< "$values")"
pass="$(awk -F':|~|:' '{print $2}' <<< "$values")" pass="$(awk -F';:~:;' '{print $2}' <<< "$values")"
pass2="$(awk -F':|~|:' '{print $3}' <<< "$values")" pass2="$(awk -F';:~:;' '{print $3}' <<< "$values")"
LUKS_NAME="$name" LUKS_NAME="$name"
fi fi