[Python-checkins] CVS: python/dist/src/Doc/lib libcrypt.tex,1.14,1.14.4.1

Peter Funk pf@artcom-gmbh.de
Tue, 15 Feb 2000 01:37:33 +0100 (MET)


Hi!

Fredrik Lundh wrote:
> mr. nitpicker strikes again:
> 
> > + \begin{verbatim}
> > + import crypt, getpass, pwd
> > + def login():
> > +     username = raw_input('Python login:')
> > +     cryptedpasswd = pwd.getpwnam(username)[1]
> > +     if cryptedpasswd:
> 
> shouldn't this function return true if the
> password is not required?

Yes.  Indeed.

> > +         if cryptedpasswd == 'x' or cryptedpasswd == '*': 
> 
> in ("x", "*"):

I must have programmed in Modula-2 and C for too long. :-(

> > +             raise "Sorry, currently no support for shadow passwords"
> > +         cleartext = getpass.getpass()
> > +         return crypt(cleartext, cryptedpasswd[0:2]) == cryptedpasswd
> 
> return crypt.crypt(cleartext, cryptedpasswd[:2]) == cryptedpasswd

Argg... :-(

> > + \end{verbatim}
> >   
> >   The module and documentation were written by Steve Majewski,
> 
> with additions by Peter Funk.

I hadn't imagined, that I could submit so many bad lines in such a
short example. :-(  I will try to prepare my next patches more
carefully!  Thanks Fredrik.

Regards, Peter
-- 
Peter Funk, Oldenburger Str.86, 27777 Ganderkesee, Tel: 04222 9502 70, Fax: -60