Fix input error on generating password and salt in install script (#3051)
* Fix potential input error on password generation This happens on macOS systems when a different locale is explicitly set. * Don't use a masked variable name
This commit is contained in:
parent
7e84c93282
commit
b26706ca90
|
|
@ -248,8 +248,13 @@ urlencode() {
|
|||
}
|
||||
|
||||
generate_password() {
|
||||
# Picked up the following method of generation from : https://gist.github.com/earthgecko/3089509
|
||||
LC_CTYPE=C tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 13 | head -n 1
|
||||
local gen_string="$(/usr/bin/python -c 'import random, string; print("".join(random.choice(string.ascii_letters + string.digits) for _ in range(13)))' 2>/dev/null)"
|
||||
if [[ -n $gen_string ]]; then
|
||||
echo "$gen_string"
|
||||
else
|
||||
# Picked up the following method of generation from : https://gist.github.com/earthgecko/3089509
|
||||
LC_ALL=C tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 13 | head -n 1
|
||||
fi
|
||||
}
|
||||
|
||||
confirm() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user