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'
|
method='des'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Checking salt
|
||||||
if [ -z "$salt" ]; then
|
if [ -z "$salt" ]; then
|
||||||
echo "Error: password missmatch"
|
echo "Error: password missmatch"
|
||||||
echo "$date $time $user $ip failed to login" >> $VESTA/log/auth.log
|
echo "$date $time $user $ip failed to login" >> $VESTA/log/auth.log
|
||||||
exit 9
|
exit 9
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Checking hash
|
# Comparing hashes
|
||||||
result=$(grep "^$user:$hash:" /etc/shadow 2>/dev/null)
|
if [[ "$shadow" != "$hash" ]]; then
|
||||||
if [[ -z "$result" ]]; then
|
|
||||||
echo "Error: password missmatch"
|
echo "Error: password missmatch"
|
||||||
echo "$date $time $user $ip failed to login" >> $VESTA/log/auth.log
|
echo "$date $time $user $ip failed to login" >> $VESTA/log/auth.log
|
||||||
exit 9
|
exit 9
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue