summaryrefslogtreecommitdiff
path: root/mailman/Utils.py
diff options
context:
space:
mode:
authorBarry Warsaw2009-01-03 05:47:41 -0500
committerBarry Warsaw2009-01-03 05:47:41 -0500
commit1d0761d2c77ef405beb93f47862d41eee3d0a820 (patch)
tree49cfe33afe1c9d3ecd4b36223486b6379e1ea03f /mailman/Utils.py
parent01f35df61d8504c4c2f07943dab9ac1a71718893 (diff)
downloadmailman-1d0761d2c77ef405beb93f47862d41eee3d0a820.tar.gz
mailman-1d0761d2c77ef405beb93f47862d41eee3d0a820.tar.zst
mailman-1d0761d2c77ef405beb93f47862d41eee3d0a820.zip
Diffstat (limited to 'mailman/Utils.py')
-rw-r--r--mailman/Utils.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/mailman/Utils.py b/mailman/Utils.py
index b53dccf92..d977ac0ca 100644
--- a/mailman/Utils.py
+++ b/mailman/Utils.py
@@ -40,10 +40,12 @@ from string import ascii_letters, digits, whitespace, Template
import mailman.templates
+from mailman import Defaults
from mailman import passwords
from mailman.config import config
from mailman.core import errors
+
AT = '@'
CR = '\r'
DOT = '.'
@@ -301,7 +303,8 @@ def Secure_MakeRandomPassword(length):
# We have no available source of cryptographically
# secure random characters. Log an error and fallback
# to the user friendly passwords.
- log.error('urandom not available, passwords not secure')
+ log.errorf(
+ 'urandom not available, passwords not secure')
return UserFriendly_MakeRandomPassword(length)
newbytes = os.read(fd, length - bytesread)
bytes.append(newbytes)
@@ -316,8 +319,8 @@ def Secure_MakeRandomPassword(length):
def MakeRandomPassword(length=None):
if length is None:
- length = config.MEMBER_PASSWORD_LENGTH
- if config.USER_FRIENDLY_PASSWORDS:
+ length = Defaults.MEMBER_PASSWORD_LENGTH
+ if Defaults.USER_FRIENDLY_PASSWORDS:
password = UserFriendly_MakeRandomPassword(length)
else:
password = Secure_MakeRandomPassword(length)