From 7e9d338e7f37ac4ac7b4e01f1ee4ac4430493add Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Thu, 13 Aug 2009 14:51:26 +0300 Subject: [PATCH] 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 --- bin/service/security.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/bin/service/security.py b/bin/service/security.py index 347dd8c13fe..ee856e8831b 100644 --- a/bin/service/security.py +++ b/bin/service/security.py @@ -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: