
here's a patch that will get passwords from a tty with echo off for mmsitepass and newlist only if it's possible, otherwise it gets the password the normal, more portable, less secure way.
scott
diff -c Mailman/Utils.py /home/mm/Mailman/Utils.py *** Mailman/Utils.py Mon Jul 27 18:48:31 1998 --- /home/mm/Mailman/Utils.py Mon Aug 3 23:27:55 1998
*** 429,431 **** --- 429,476 ---- if raw: return template % dict return wrap(template % dict) + +
def getapwtty(prmpt="Password: "):
wrote_prmpt = 0
try:
import termios, TERMIOS
fd = sys.stdin.fileno()
org = termios.tcgetattr(fd)
new = termios.tcgetattr(fd)
new[3] = new[3] & ~TERMIOS.ECHO
termios.tcsetattr(fd, TERMIOS.TCSANOW, new)
sys.stdout.write(prmpt)
sys.stdout.flush()
wrote_prmpt = 1
pw = string.strip(raw_input())
sys.stdout.write("\n")
sys.stdout.flush()
termios.tcsetattr(fd, TERMIOS.TCSAFLUSH, org)
return pw
except:
if wrote_prmpt:
prmpt = ""
pw = string.strip(raw_input(prmtp))
return pw
def getpw():
while 1:
pw1 = getapwtty()
pw2 = getapwtty("Verify: ")
if pw1 == pw2:
break
else:
print "passwords didn't match, try again"
return pw1
diff -c bin/mmsitepass /home/mm/bin/mmsitepass *** bin/mmsitepass Mon Jul 27 18:48:31 1998 --- /home/mm/bin/mmsitepass Mon Aug 3 23:32:11 1998
*** 22,38 **** administrator's password can be used, which in turn can be used in most places that a list users password can be used."""
- import sys import paths from Mailman import MailList
! def main(argv): ! if len(sys.argv) != 2: ! print "Usage: mmsitepass password" ! raise SystemExit, 1 l = MailList.MailList() ! l.SetSiteAdminPassword(sys.argv[1]) ! if l.CheckSiteAdminPassword(sys.argv[1]): print "Password changed." raise SystemExit, 0 else: --- 22,36 ---- administrator's password can be used, which in turn can be used in most places that a list users password can be used."""
import paths from Mailman import MailList
- from Mailman.Utils import getpw
! def main(): ! print "enter a site password for mailman" ! pw = getpw() l = MailList.MailList() ! if l.CheckSiteAdminPassword(pw): print "Password changed." raise SystemExit, 0 else:
*** 40,43 **** raise SystemExit, 1
if __name__ == "__main__": ! main(sys.argv) --- 38,48 ---- raise SystemExit, 1
if __name__ == "__main__": ! main() ! ! ! ! ! ! !
diff -c bin/newlist /home/mm/bin/newlist *** bin/newlist Mon Jul 27 18:48:31 1998 --- /home/mm/bin/newlist Mon Aug 3 23:33:22 1998
*** 71,77 **** if len(argv) > 3: list_pw = argv[3] else: ! list_pw = raw_input("Enter the initial list password: ")
newlist = MailList.MailList()
pw = crypt(list_pw , Utils.GetRandomSeed())
--- 71,78 ---- if len(argv) > 3: list_pw = argv[3] else: ! print "Please Enter the initial list password." ! list_pw = Utils.getpw()
newlist = MailList.MailList()
pw = crypt(list_pw , Utils.GetRandomSeed())

"S" == Scott <scott@chronis.pobox.com> writes:
S> here's a patch that will get passwords from a tty with echo
S> off for mmsitepass and newlist only if it's possible, otherwise
S> it gets the password the normal, more portable, less secure
S> way.
Why would you not want to use the Python standard getpass module?
-Barry

Hiyas,
I've caught the multiple delivery bug: if processQueue() runs while another processQueue() is running, the delivery will have messed up (== multiple delivery).
BTW where can I find the package's configure.in file? It can be very helpful.
-- hacker: /n./ One who enjoys the intellectual challenge of creatively overcoming or circumventing limitations. PGP 0x1DE3631D / A8 B4 92 EE 1F 55 27 C8 86 64 9C 42 41 A4 BD B8

"NB" == Nagy Balazs <julian7@kva.hu> writes:
NB> I've caught the multiple delivery bug: if processQueue() runs
NB> while another processQueue() is running, the delivery will
NB> have messed up (== multiple delivery).
Thanks for the clue. Hopefull one of us will get time to look at this very soon.
NB> BTW where can I find the package's configure.in file? It can
NB> be very helpful.
Is it not distributed in the 1.0b5 tarball? Darn. Well, this is your chance to try out the read-only anoncvs access I sent a message out about. You can definitely get that file through CVS.
-Barry
participants (3)
-
Barry A. Warsaw
-
Nagy Balazs
-
Scott