summaryrefslogtreecommitdiffstats
path: root/git-interface/git-auth.py
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2015-06-26 08:52:58 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2015-06-27 13:04:03 +0200
commitb036b436aa64be000481f8d1da30ff53d4bcb889 (patch)
tree152fe703c11a79a1904e362271d5022b9d784a5b /git-interface/git-auth.py
parentdbe56342a19692cba6a6cd8e79a4e6b65a6d659e (diff)
downloadaurweb-b036b436aa64be000481f8d1da30ff53d4bcb889.tar.xz
Add support for multiple SSH public keys
Attaching more than one SSH public key to the same account is useful, e.g. if one uses different machines to access the AUR SSH interface. Multiple keys can now be specified by adding multiple lines to the text area on the account edit form. Implements FS#45469. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org> Acked-by: Leonidas Spyropoulos <artafinde@gmail.com>
Diffstat (limited to 'git-interface/git-auth.py')
-rwxr-xr-xgit-interface/git-auth.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/git-interface/git-auth.py b/git-interface/git-auth.py
index b67d9de..c7de777 100755
--- a/git-interface/git-auth.py
+++ b/git-interface/git-auth.py
@@ -47,8 +47,10 @@ db = mysql.connector.connect(host=aur_db_host, user=aur_db_user,
unix_socket=aur_db_socket, buffered=True)
cur = db.cursor()
-cur.execute("SELECT Username, AccountTypeID FROM Users WHERE SSHPubKey = %s " +
- "AND Suspended = 0", (keytype + " " + keytext,))
+cur.execute("SELECT Users.Username, Users.AccountTypeID FROM Users " +
+ "INNER JOIN SSHPubKeys ON SSHPubKeys.UserID = Users.ID "
+ "WHERE SSHPubKeys.PubKey = %s AND Users.Suspended = 0",
+ (keytype + " " + keytext,))
if cur.rowcount != 1:
exit(1)