Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SUCCESS! Re: PHP change password script



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







BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org