Skip to content

Commit 75e2c27

Browse files
committed
Fixed an issue which cause wrong password generation
Fixes hestiacp#1184
1 parent 0e40dcb commit 75e2c27

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ All notable changes to this project will be documented in this file.
4343
- Changed WordPress name in Webapp installer (#1074)
4444
- Add a free disk space validation during backup routine (#1115)
4545
- Removed PHP validation SSH keys allowing support other types then RSA / DSA
46+
- Fixed an issue which cause wrong password generation (#1184)
4647

4748

4849
## [1.2.3] - Service Release

bin/v-generate-api-key

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
# Variable&Function #
1010
#----------------------------------------------------------#
1111

12-
keygen()
13-
{
12+
keygen() {
1413
< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo;
1514
}
1615
KEYS="$HESTIA/data/keys/"

func/main.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,12 @@ generate_password() {
186186
matrix=$1
187187
length=$2
188188
if [ -z "$matrix" ]; then
189-
matrix=[:alnum:]
189+
matrix="A-Za-z0-9"
190190
fi
191191
if [ -z "$length" ]; then
192192
length=10
193193
fi
194-
cat /dev/urandom | tr -dc $matrix | head -c$length
194+
head /dev/urandom | tr -dc $matrix | head -c$length
195195
}
196196

197197
# Package existence check

install/hst-install-debian.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ download_file() {
107107

108108
# Defining password-gen function
109109
gen_pass() {
110-
cat /dev/urandom | tr -dc [:alnum:] | head -c16
110+
head /dev/urandom | tr -dc A-Za-z0-9 | head -c 16
111111
}
112112

113113
# Defining return code check function

install/hst-install-ubuntu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ download_file() {
8989

9090
# Defining password-gen function
9191
gen_pass() {
92-
cat /dev/urandom | tr -dc [:alnum:] | head -c16
92+
head /dev/urandom | tr -dc A-Za-z0-9 | head -c 16
9393
}
9494

9595
# Defining return code check function

test/test.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ load 'test_helper/bats-file/load'
66

77

88
function random() {
9-
cat /dev/urandom | tr -dc [:digit:] | head -c$1
9+
head /dev/urandom | tr -dc A-Za-z0-9 | head -c$1
1010
}
1111

1212
function setup() {

test/test_actions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ V_TEST="$HESTIA/test"
77

88
# Define functions
99
random() {
10-
cat /dev/urandom | tr -dc [:digit:] | head -c$1
10+
head /dev/urandom | tr -dc A-Za-z0-9 | head -c$1
1111
}
1212

1313
echo_result() {

0 commit comments

Comments
 (0)