[Mailman-Users] Password Authentication Problem (2)

Dan Mick Dan.Mick at west.sun.com
Thu Nov 30 21:29:04 CET 2000


Dan Mick wrote:
> 
> A technique:
> 
> If you, at the top of the module you'd like to debug, put
> 
> from Mailman.Logging.Syslog import syslog
> 
> and then, where you'd like to see what's going on, put
> 
> syslog('filename', 'string with printf formats like this: %s', stringvar)

<sigh>  Sorry; I mean

syslog('filename', 'string with printf formats like this: %s' % stringvar)

(note the last "comma" is wrong; it should be "%"

Do multiple values by making the value list a tuple:

syslog('otherfilename', 'two strings: s1: %s s2; %s' % (stringvar1, stringvar2))
 
> or something similar, you'll get a file in ~mailman/logs named 'filename' that
> has your printfs in it.  Perhaps you can figure out which part of the process
> seems to be going wrong.
> 
> > Torjus Jensen wrote:
> >
> > In an earlier e-mail we had asked for help with a problem where the site admin password would not authenticate. SInce
> > we did not get any response, we began looking into the code.
> >
> > We have determined that the problem is either that writing to the adm.pw file fails, or reading from it fails:
> >
> >
> > From Utils.py:
> >
> >
> > def SetSiteAdminPassword(pw):
> >     fp = open_ex(mm_cfg.SITE_PW_FILE, 'w', perms=0640)
> >     fp.write(Crypt.crypt(pw, GetRandomSeed()))
> >     fp.close()
> >
> > def CheckSiteAdminPassword(pw1):
> >     try:
> >         f = open(mm_cfg.SITE_PW_FILE)
> >         pw2 = f.read()
> >         f.close()
> >         return Crypt.crypt(pw1, pw2[:2]) == pw2
> >     # There probably is no site admin password if there was an exception
> >     except IOError:
> >         return 0
> >
> > If we substitute def CheckSiteAdminPassword  with:
> >
> > #def CheckSiteAdminPassword(pw1):
> >         #return 1
> >
> > we are able to log in (obviously).
> >
> > We have checked permissions on the adm.pw, and noted that it is indeed written to when calling mmsitepass. Our guess
> > is therefore that the problem is either in reading from the file, or in the Crypt.crypt function.
> >
> > Since we are not at all familiar with Python, we would appreciate some help.
> >
> > Thanks.
> >
> > --------------------------
> > Torjus Jensen
> > http://www.edudex.com
> 
> ------------------------------------------------------
> Mailman-Users maillist  -  Mailman-Users at python.org
> http://www.python.org/mailman/listinfo/mailman-users




More information about the Mailman-Users mailing list