From a99542ed6dd6eb4fa38f75de4d6d9c8722a30fe3 Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Sun, 6 Jan 2002 07:49:03 +0000 Subject: get_global_password(): Factor this out of check_global_password because SecurityManager now may want the actual site password, for (optionally) setting a site cookie. --- Mailman/Utils.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'Mailman/Utils.py') diff --git a/Mailman/Utils.py b/Mailman/Utils.py index ccaff76bb..82b67dada 100644 --- a/Mailman/Utils.py +++ b/Mailman/Utils.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998,1999,2000,2001 by the Free Software Foundation, Inc. +# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -355,7 +355,7 @@ def set_global_password(pw, siteadmin=1): os.umask(omask) -def check_global_password(response, siteadmin=1): +def get_global_password(siteadmin=1): if siteadmin: filename = mm_cfg.SITE_PW_FILE else: @@ -367,7 +367,14 @@ def check_global_password(response, siteadmin=1): except IOError, e: if e.errno <> errno.ENOENT: raise # It's okay not to have a site admin password, just return false - return 0 + return None + return challenge + + +def check_global_password(response, siteadmin=1): + challenge = get_global_password(siteadmin) + if challenge is None: + return None return challenge == sha.new(response).hexdigest() -- cgit v1.2.3-70-g09d2