|
@@ -43,17 +43,6 @@ if [[ -z "$password" ]]; then
|
|
|
exit 9
|
|
exit 9
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
-# Checking mkpasswd command
|
|
|
|
|
-which mkpasswd >/dev/null 2>&1
|
|
|
|
|
-if [ $? -ne 0 ]; then
|
|
|
|
|
- # Activating fallback procedure
|
|
|
|
|
- if [ -e "/usr/bin/yum" ]; then
|
|
|
|
|
- yum install -y expect >/dev/null 2>&1
|
|
|
|
|
- else
|
|
|
|
|
- apt-get install -y expect >/dev/null 2>&1
|
|
|
|
|
- fi
|
|
|
|
|
-fi
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
#----------------------------------------------------------#
|
|
|
# Action #
|
|
# Action #
|
|
@@ -68,7 +57,7 @@ if [[ -z "$salt" ]] || [[ "${#salt}" -gt 8 ]]; then
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
# Generating SHA-512
|
|
# Generating SHA-512
|
|
|
-hash=$(mkpasswd -m sha-512 -S $salt -s <<< $password)
|
|
|
|
|
|
|
+hash=$($BIN/v-generate-password-hash sha-512 $salt <<< $password)
|
|
|
if [[ -z "$hash" ]]; then
|
|
if [[ -z "$hash" ]]; then
|
|
|
echo "Error: password missmatch"
|
|
echo "Error: password missmatch"
|
|
|
echo "$DATE $user $ip failed to login" >> $VESTA/log/auth.log
|
|
echo "$DATE $user $ip failed to login" >> $VESTA/log/auth.log
|