shithub: werc

Download patch

ref: 34155f0d5bd26886aae5977e36618f9eba85da9f
parent: 352340bf902a356a4d5d857538d78b5a6ee8b403
author: sl <uriel@engel.se.cat-v.org>
date: Sat Feb 28 07:56:13 EST 2009

Be more careful when checking passwords, make sure that the password file exists and is not empty.

--- a/bin/werclib.rc
+++ b/bin/werclib.rc
@@ -68,7 +68,7 @@
         status=('Auth: missing user name or pass: '^$"user_name^' / '^$"user_password)
     if not if(! test -f $pfile)
         status=('Auth: cant find '^$pfile)
-    if not if(! ~ $user_password `{cat $pfile})
+    if not if(! test -s $pfile || ! ~ $user_password `{cat $pfile})
         status=('Auth: Pass '$user_password' doesnt match '^`{cat $pfile})
     if not {
         logged_user=$user_name