mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 09:43:03 +00:00
More descriptive tupkg error message
Catch sql server connection death
This commit is contained in:
parent
70af7c7d5c
commit
1c4883edba
2 changed files with 12 additions and 5 deletions
|
@ -119,11 +119,15 @@ class ClientSocket(threading.Thread):
|
|||
m = md5.new()
|
||||
m.update(authdata['password'][0])
|
||||
encpw = m.hexdigest()
|
||||
q.execute("SELECT ID, Suspended, AccountTypeID FROM Users WHERE Username = '"+
|
||||
MySQLdb.escape_string(authdata['username'][0])+
|
||||
"' AND Passwd = '"+
|
||||
MySQLdb.escape_string(encpw)+
|
||||
"'")
|
||||
try:
|
||||
q.execute("SELECT ID, Suspended, AccountTypeID FROM Users WHERE Username = '"+
|
||||
MySQLdb.escape_string(authdata['username'][0])+
|
||||
"' AND Passwd = '"+
|
||||
MySQLdb.escape_string(encpw)+
|
||||
"'")
|
||||
except MySQLdb.OperationalError:
|
||||
self.sendMsg("result=SQLERR")
|
||||
return 0
|
||||
if q.rowcount == 0:
|
||||
self.sendMsg("result=FAIL")
|
||||
return 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue