Security: check_creds is not really needed, use "check"
The "check" function would not return a False value anyway, so don't use wrapping one. bzr revid: p_christ@hol.gr-20090813115126-hv1uz009ltcnid2y
This commit is contained in:
@@ -51,7 +51,7 @@ def check_super(passwd):
|
||||
else:
|
||||
raise ExceptionNoTb('AccessDenied')
|
||||
|
||||
def check_creds(db, uid, passwd):
|
||||
def check(db, uid, passwd):
|
||||
if _uid_cache.get(db, {}).get(uid) and _uid_cache.get(db, {}).get(uid) == passwd:
|
||||
return True
|
||||
cr = pooler.get_db(db).cursor()
|
||||
@@ -83,10 +83,5 @@ def access(db, uid, passwd, sec_level, ids):
|
||||
raise ExceptionNoTb('Bad username or password')
|
||||
return res[0]
|
||||
|
||||
def check(db, uid, passwd):
|
||||
if not check_creds(db,uid,passwd):
|
||||
raise ExceptionNoTb('Bad username or password')
|
||||
pass
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user