~launchpad-pqm/mailman/2.1

« back to all changes in this revision

Viewing changes to bin/change_pw

  • Committer: Launchpad Patch Queue Manager
  • Date: 2009-10-21 01:06:17 UTC
  • mfrom: (975.1.1 mailman.2112)
  • Revision ID: launchpad@pqm.canonical.com-20091021010617-prbs2ay6nhxx515v
[rs=flacoste] Upgrade Mailman to upstream 2.1.12

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! @PYTHON@
2
2
#
3
 
# Copyright (C) 2001-2004 by the Free Software Foundation, Inc.
 
3
# Copyright (C) 2001-2008 by the Free Software Foundation, Inc.
4
4
#
5
5
# This program is free software; you can redistribute it and/or
6
6
# modify it under the terms of the GNU General Public License
14
14
#
15
15
# You should have received a copy of the GNU General Public License
16
16
# along with this program; if not, write to the Free Software
17
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
17
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 
18
# USA.
18
19
 
19
20
"""Change a list's password.
20
21
 
65
66
"""
66
67
 
67
68
import sys
68
 
import sha
69
69
import getopt
70
70
 
71
71
import paths
133
133
        elif opt in ('-d', '--domain'):
134
134
            domains[arg] = 1
135
135
        elif opt in ('-l', '--listname'):
136
 
            listnames[arg] = 1
 
136
            listnames[arg.lower()] = 1
137
137
        elif opt in ('-p', '--password'):
138
138
            password = arg
139
139
        elif opt in ('-q', '--quiet'):
146
146
    if password is not None:
147
147
        if not password:
148
148
            usage(1, _('Empty list passwords are not allowed'))
149
 
        shapassword = sha.new(password).hexdigest()
 
149
        shapassword = Utils.sha_new(password).hexdigest()
150
150
 
151
151
    if domains:
152
152
        for name in Utils.list_names():
166
166
            if password is None:
167
167
                randompw = Utils.MakeRandomPassword(
168
168
                    mm_cfg.ADMIN_PASSWORD_LENGTH)
169
 
                shapassword = sha.new(randompw).hexdigest()
 
169
                shapassword = Utils.sha_new(randompw).hexdigest()
170
170
                notifypassword = randompw
171
171
            else:
172
172
                notifypassword = password