summaryrefslogtreecommitdiff
path: root/Mailman
diff options
context:
space:
mode:
authortkikuchi2007-02-03 11:04:58 +0000
committertkikuchi2007-02-03 11:04:58 +0000
commit678004c08124357d1ba23082d7c745e1a3990159 (patch)
treea00fdd8d2552bb2a9dc48917f14f875343f50d6e /Mailman
parentd8ebc777fd8cc1cc2e60fba67ef29137e0329bb0 (diff)
downloadmailman-678004c08124357d1ba23082d7c745e1a3990159.tar.gz
mailman-678004c08124357d1ba23082d7c745e1a3990159.tar.zst
mailman-678004c08124357d1ba23082d7c745e1a3990159.zip
Where should etc directory belong, $prefix or $var-prefix?
I put it in $var-prefix. mmsitepass.py ... parseargs() fails because config is not loaded before initialize(config). passwords.make_secret() should be called.
Diffstat (limited to 'Mailman')
-rw-r--r--Mailman/Cgi/create.py2
-rw-r--r--Mailman/bin/mmsitepass.py14
2 files changed, 12 insertions, 4 deletions
diff --git a/Mailman/Cgi/create.py b/Mailman/Cgi/create.py
index 0ebe7b9f6..ed29e7f59 100644
--- a/Mailman/Cgi/create.py
+++ b/Mailman/Cgi/create.py
@@ -161,7 +161,7 @@ def process_request(doc, cgidata):
# We've got all the data we need, so go ahead and try to create the list
mlist = MailList.MailList()
try:
- pw = passwords(password, config.PASSWORD_SCHEME)
+ pw = passwords.make_secret(password, config.PASSWORD_SCHEME)
try:
mlist.Create(fqdn_listname, owner, pw, langs)
except Errors.EmailAddressError, s:
diff --git a/Mailman/bin/mmsitepass.py b/Mailman/bin/mmsitepass.py
index 0d986bf6a..47f48b083 100644
--- a/Mailman/bin/mmsitepass.py
+++ b/Mailman/bin/mmsitepass.py
@@ -52,7 +52,7 @@ Set the list creator password instead of the site password. The list
creator is authorized to create and remove lists, but does not have
the total power of the site administrator."""))
parser.add_option('-p', '--password-scheme',
- default=config.PASSWORD_SCHEME, type='string',
+ default='', type='string',
help=_("""\
Specify the RFC 2307 style hashing scheme for passwords included in the
output. Use -P to get a list of supported schemes, which are
@@ -70,15 +70,23 @@ case-insensitive."""))
for label in passwords.SCHEMES:
print label.upper()
sys.exit(0)
- if opts.password_scheme.lower() not in passwords.SCHEMES:
- parser.error(_('Invalid password scheme'))
return parser, opts, args
+def check_password_scheme(parser, password_scheme):
+ # shoule be checked after config is loaded.
+ if password_scheme == '':
+ password_scheme = config.PASSWORD_SCHEME
+ if password_scheme.lower() not in passwords.SCHEMES:
+ parser.error(_('Invalid password scheme'))
+ return password_scheme
+
+
def main():
parser, opts, args = parseargs()
initialize(opts.config)
+ opts.password_scheme = check_password_scheme(parser, opts.password_scheme)
if args:
password = args[0]
else: