summaryrefslogtreecommitdiffstats
path: root/tupkg/server/tupkgs
diff options
context:
space:
mode:
authorsimo <simo>2005-12-18 01:17:58 +0100
committersimo <simo>2005-12-18 01:17:58 +0100
commit1c4883edbab3f6a59598f54c894f62fa8590cf28 (patch)
tree8f891d99623a6b6b73cbd760e789dbdaa31c84d5 /tupkg/server/tupkgs
parent70af7c7d5c5945039f494ca5f9e435bc515db18e (diff)
downloadaur-1c4883edbab3f6a59598f54c894f62fa8590cf28.tar.gz
aur-1c4883edbab3f6a59598f54c894f62fa8590cf28.tar.xz
More descriptive tupkg error message
Catch sql server connection death
Diffstat (limited to 'tupkg/server/tupkgs')
-rwxr-xr-xtupkg/server/tupkgs14
1 files changed, 9 insertions, 5 deletions
diff --git a/tupkg/server/tupkgs b/tupkg/server/tupkgs
index ca9ab26d..05d60241 100755
--- a/tupkg/server/tupkgs
+++ b/tupkg/server/tupkgs
@@ -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