SUCCESS! Re: PHP change password script

Greg Rundlett (freephile) greg-SfI3QVg0eaJl57MIdRCFDg at public.gmane.org
Wed May 27 11:03:51 EDT 2009


On Wed, May 27, 2009 at 9:56 AM, Derek Atkins <warlord-3s7WtUTddSA at public.gmane.org> wrote:
> I got my PHP working.  Here's the new changePassword function
> that works for me.  It's using expect in a different way and
> this time it actually looks for various errors.  I've tried
> just about every path and no longer do I get output into my
> http error log.  :)
>
> Thanks for the pointers.  What helped me was a google search
> looking for expect programs to interface to passwd, and I
> found http://www.plug.org/pipermail/plug/2004-September/012386.html
>
> Enjoy!

I've seen many tutorials or examples [1][2] that include expect
"assword", and note that you don't have to chop off the 'p' to avoid
problems with case-sensitivity.

Expect supports regular expressions (by default or using the -re option)
expect "*?assword:*"

Expect supports caseless patterns
expect -nocase "password:"

[1] from NIST where the project originated
http://expect.nist.gov/example/autopasswd
[2] http://floppsie.comp.glam.ac.uk/Glamorgan/gaius/scripting/5.html

In the entymological sense, I wonder if the prevalence of one
particular early example has led to this current indelicateness.  Or,
perhaps -nocase and -re options were added later.

-- 
Greg Rundlett
Web Developer - Initiative in Innovative Computing
http://iic.harvard.edu
camb 617-384-5872
nbpt 978-225-8302
m. 978-764-4424
-skype/aim/irc/twitter freephile
http://profiles.aim.com/freephile






More information about the Discuss mailing list