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

Fredrik Lundh Fredrik Lundh" <effbot@telia.com
Mon, 14 Feb 2000 23:39:47 +0100


mr. nitpicker strikes again:

> + \begin{verbatim}
> + import crypt, getpass, pwd
> + def login():
> +     username =3D raw_input('Python login:')
> +     cryptedpasswd =3D pwd.getpwnam(username)[1]
> +     if cryptedpasswd:

shouldn't this function return true if the
password is not required?

> +         if cryptedpasswd =3D=3D 'x' or cryptedpasswd =3D=3D '*':=20

in ("x", "*"):

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

return crypt.crypt(cleartext, cryptedpasswd[:2]) =3D=3D cryptedpasswd

> + \end{verbatim}
>  =20
>   The module and documentation were written by Steve Majewski,

with additions by Peter Funk.

</F>