mirror of
https://github.com/myvesta/vesta
synced 2025-07-06 04:51:54 -07:00
RACK911LABS.COM: simpler and safer hash check
This commit is contained in:
parent
d14b7d969c
commit
73e6656986
1 changed files with 3 additions and 3 deletions
|
@ -75,15 +75,15 @@ else
|
|||
method='des'
|
||||
fi
|
||||
|
||||
# Checking salt
|
||||
if [ -z "$salt" ]; then
|
||||
echo "Error: password missmatch"
|
||||
echo "$date $time $user $ip failed to login" >> $VESTA/log/auth.log
|
||||
exit 9
|
||||
fi
|
||||
|
||||
# Checking hash
|
||||
result=$(grep "^$user:$hash:" /etc/shadow 2>/dev/null)
|
||||
if [[ -z "$result" ]]; then
|
||||
# Comparing hashes
|
||||
if [[ "$shadow" != "$hash" ]]; then
|
||||
echo "Error: password missmatch"
|
||||
echo "$date $time $user $ip failed to login" >> $VESTA/log/auth.log
|
||||
exit 9
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue