Skip to content

Commit

Permalink
Fix wrong password verification.
Browse files Browse the repository at this point in the history
  • Loading branch information
HappyBasher committed Feb 10, 2023
1 parent af274ed commit b51d484
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions linbofs/usr/bin/linbo_auth
Expand Up @@ -2,7 +2,7 @@
#
# linbo_auth
# thomas@linuxmuster.net
# 20230201
# 20230210
#

usage(){
Expand All @@ -28,8 +28,7 @@ if [ -s /etc/linbo_pwhash -a -s /etc/linbo_salt ]; then
echo "Using local authentication ..."
linbo_pwhash="$(cat /etc/linbo_pwhash)"
linbo_salt="$(cat /etc/linbo_salt)"
cpus="$(LANG=C grep -c ^processor /proc/cpuinfo)"
given_pwhash="$(echo "$RSYNC_PASSWORD" | LANG=C argon2 "$linbo_salt" -t 1000 -p $cpus | grep ^Hash | awk '{print $2}')"
given_pwhash="$(echo "$RSYNC_PASSWORD" | LANG=C argon2 "$linbo_salt" -t 1000 | grep ^Hash | awk '{print $2}')"
if [ "$given_pwhash" = "$linbo_pwhash" ]; then
msg="Password matches."; RC=0
# temporary workaround for password
Expand Down
5 changes: 2 additions & 3 deletions serverfs/usr/sbin/update-linbofs
Expand Up @@ -6,7 +6,7 @@
#
# thomas@linuxmuster.net
# GPL V3
# 20230201
# 20230210
#

# read linuxmuster environment
Expand Down Expand Up @@ -121,8 +121,7 @@ fi
# hash of linbo password goes into linbofs
echo -n "Hashing linbo password ... "
linbo_salt="$(tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' </dev/urandom | head -c 32 ; echo)"
cpus="$(LANG=C grep -c ^processor /proc/cpuinfo)"
linbo_pwhash="$(echo "$linbo_passwd" | LANG=C argon2 "$linbo_salt" -t 1000 -p $cpus | grep ^Hash | awk '{print $2}')"
linbo_pwhash="$(echo "$linbo_passwd" | LANG=C argon2 "$linbo_salt" -t 1000 | grep ^Hash | awk '{print $2}')"
if [ -n "$linbo_salt" -a -n "$linbo_pwhash" ]; then
echo "Success!"
else
Expand Down

0 comments on commit b51d484

Please sign in to comment.