]> git.plutz.net Git - busy/blobdiff - actions/login.sh
make sure login user exists
[busy] / actions / login.sh
index 6705eca2370e12aa6273bbd62d91f8cc368f0439..8cd9e74af2153cf6f5cf1b41d8a3e503892a2a63 100755 (executable)
@@ -26,7 +26,7 @@ if [ -r "$userfile" ]; then
   ssum=$(sed -nr 's:^auth=(.+)$:\1:p' "$userfile")
   rsum=$(echo -E "$salt$pass" |sha1sum |cut -c1-40)
 fi
-if [ "$ssum" = "$rsum" ]; then
+if [ -n "$ssum" -a  "$ssum" = "$rsum" ]; then
   sid="$(apg -n1 -a1 -m32 -x32 -M CLN)"
   sessionfile="$_DATA/auth/session$sid"
   echo -E "$user $(($(date +%s) + 1800))" >"$sessionfile"