Improve password separators to avoid issues when using '~'

This commit is contained in:
natemaia 2019-01-18 00:42:21 -08:00
parent b3ff098262
commit 98c56c9334

View File

@ -8,7 +8,7 @@
# Some ideas and code has been taken from other installers
# AIF, Cnichi, Calamares, The Arch Wiki.. Credit where credit is due
VER="1.8.34" # version
VER="1.8.35" # version
DIST="ArchLabs" # distributor
MNT="/mnt" # install mountpoint
@ -355,10 +355,10 @@ mkuser()
{
tput cnorm
local values
if ! values="$(dialog --stdout --no-cancel --separator '~' \
if ! values="$(dialog --stdout --no-cancel --separator ':|~|:' \
--ok-label "Submit" --backtitle "$BT" --title " $_UserTitle " \
--insecure --mixedform "$_UserBody" 0 0 0 \
"$_Username" 1 1 "" 1 $((${#_Username} + 2)) $COLUMNS 0 0 \
"$_Username" 1 1 "$NEWUSER" 1 $((${#_Username} + 2)) $COLUMNS 0 0 \
"$_Password" 2 1 "" 2 $((${#_Password} + 2)) $COLUMNS 0 1 \
"$_Password2" 3 1 "" 3 $((${#_Password2} + 2)) $COLUMNS 0 1 \
"$_RootBody" 6 1 "" 6 $((${#_RootBody} + 1)) $COLUMNS 0 2 \
@ -368,11 +368,11 @@ mkuser()
fi
local user pass pass2 rpass rpass2
user="$(awk -F'~' '{print $1}' <<< "$values")"
pass="$(awk -F'~' '{print $2}' <<< "$values")"
pass2="$(awk -F'~' '{print $3}' <<< "$values")"
rpass="$(awk -F'~' '{print $5}' <<< "$values")"
rpass2="$(awk -F'~' '{print $6}' <<< "$values")"
user="$(awk -F':|~|:' '{print $1}' <<< "$values")"
pass="$(awk -F':|~|:' '{print $2}' <<< "$values")"
pass2="$(awk -F':|~|:' '{print $3}' <<< "$values")"
rpass="$(awk -F':|~|:' '{print $5}' <<< "$values")"
rpass2="$(awk -F':|~|:' '{print $6}' <<< "$values")"
# both root passwords are empty, so use the user passwords instead
[[ $rpass == "" && $rpass2 == "" ]] && { rpass="$pass"; rpass2="$pass2"; }
@ -2243,29 +2243,27 @@ luks_pass()
tput cnorm
local values
if [[ $name == "" ]]; then
if ! values="$(dialog --stdout --no-cancel --separator '~' \
--ok-label "Submit" --backtitle "$BT" \
--title " $title " --insecure --mixedform \
"\nEnter the password to decrypt $ROOT_PART.
\nThis is needed to create a keyfile." 0 0 6 \
if ! values="$(dialog --stdout --no-cancel --separator ':|~|:' \
--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 \
"$_Password" 1 1 "" 1 $((${#_Password} + 2)) $COLUMNS 0 1 \
"$_Password2" 2 1 "" 2 $((${#_Password2} + 2)) $COLUMNS 0 1)"; then
return 1
fi
pass="$(awk -F'~' '{print $1}' <<< "$values")"
pass2="$(awk -F'~' '{print $2}' <<< "$values")"
pass="$(awk -F':|~|:' '{print $1}' <<< "$values")"
pass2="$(awk -F':|~|:' '{print $2}' <<< "$values")"
else
if ! values="$(dialog --stdout --no-cancel --separator '~' \
if ! values="$(dialog --stdout --no-cancel --separator ':|~|:' \
--ok-label "Submit" --backtitle "$BT" --title " $title " \
--insecure --mixedform "$_LuksOpenBody" 0 0 6 \
--insecure --mixedform "$_LuksOpenBody" 0 0 0 \
"$_Name" 1 1 "$name" 1 $((${#_Name} + 2)) $COLUMNS 0 0 \
"$_Password" 2 1 "" 2 $((${#_Password} + 2)) $COLUMNS 0 1 \
"$_Password2" 3 1 "" 3 $((${#_Password2} + 2)) $COLUMNS 0 1)"; then
return 1
fi
name="$(awk -F'~' '{print $1}' <<< "$values")"
pass="$(awk -F'~' '{print $2}' <<< "$values")"
pass2="$(awk -F'~' '{print $3}' <<< "$values")"
name="$(awk -F':|~|:' '{print $1}' <<< "$values")"
pass="$(awk -F':|~|:' '{print $2}' <<< "$values")"
pass2="$(awk -F':|~|:' '{print $3}' <<< "$values")"
LUKS_NAME="$name"
fi
@ -2507,9 +2505,9 @@ load_bcm()
chk_connect()
{
if [[ $CHECKED_NET == true ]]; then
infobox "Network Connect" "\nVerifying connection to https://www.archlinux.org\n" 0
infobox "Network Connect" "\nVerifying connection to https://www.archlinux.org\n" 1
else
infobox "Network Connect" "\nChecking connection to https://www.archlinux.org\n" 0
infobox "Network Connect" "\nChecking connection to https://www.archlinux.org\n" 1
CHECKED_NET=true
fi
curl -sI --connect-timeout 5 'https://www.archlinux.org/' | sed '1q' | grep -q '200'