]> git.plutz.net Git - busy/commitdiff
make sure login user exists
authorpaul <paul@plutz.net>
Wed, 18 Mar 2015 12:56:32 +0000 (12:56 +0000)
committerpaul <paul@plutz.net>
Wed, 18 Mar 2015 12:56:32 +0000 (12:56 +0000)
svn path=/trunk/; revision=60

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"