diff options
author | Lukas Fleischer <lfleischer@archlinux.org> | 2015-06-26 08:52:58 +0200 |
---|---|---|
committer | Lukas Fleischer <lfleischer@archlinux.org> | 2015-06-27 13:04:03 +0200 |
commit | b036b436aa64be000481f8d1da30ff53d4bcb889 (patch) | |
tree | 152fe703c11a79a1904e362271d5022b9d784a5b /git-interface | |
parent | dbe56342a19692cba6a6cd8e79a4e6b65a6d659e (diff) | |
download | aur-b036b436aa64be000481f8d1da30ff53d4bcb889.tar.gz aur-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')
-rwxr-xr-x | git-interface/git-auth.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/git-interface/git-auth.py b/git-interface/git-auth.py index b67d9de5..c7de777f 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) |