[PATCH] git-auth: deny login if no password has been set

Lukas Fleischer lfleischer at archlinux.org
Sat Apr 27 13:03:58 UTC 2019


After creating a new account, users need to verify their email address
and set an initial password. Without setting a password, users cannot
use their account on the web interface. However, when logging in via
SSH, we did not check whether the account is verified.

Fix this by only allowing SSH access once a password is set.

Reported-by: Pat Hogan <pathtofile at gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer at archlinux.org>
---
 aurweb/git/auth.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/aurweb/git/auth.py b/aurweb/git/auth.py
index 828ed4e..3b1e485 100755
--- a/aurweb/git/auth.py
+++ b/aurweb/git/auth.py
@@ -39,7 +39,8 @@ def main():
 
     cur = conn.execute("SELECT Users.Username, Users.AccountTypeID FROM Users "
                        "INNER JOIN SSHPubKeys ON SSHPubKeys.UserID = Users.ID "
-                       "WHERE SSHPubKeys.PubKey = ? AND Users.Suspended = 0",
+                       "WHERE SSHPubKeys.PubKey = ? AND Users.Suspended = 0 "
+                       "AND NOT Users.Passwd = ''",
                        (keytype + " " + keytext,))
 
     row = cur.fetchone()
-- 
2.21.0


More information about the aur-dev mailing list