Re: problems with basic authentication .htpasswd called from php exec()
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: problems with basic authentication .htpasswd called from php exec()

From: Gordon Burditt <gordonb.qbebh@burditt.org>
Date: Tue Jul 12 2005 - 03:59:46 CEST

>I'm trying to use php to update my htpasswd file.
>
>I have my permissions on .htpasswd set to 777, so it should be wide
>open.

Apache tends to react to excessive permissions on files (or on
directories containing them) by refusing to use them. Setting a
CGI or the directory it's in to mode 777 is a great way to make it
not work. I'm not sure what the situation would be with a
world-writable .htpasswd file.

>>From the command line (when logged into the server as "nobody",
>my server's web user) I can get the htpasswd.exe to run without a
>problem, but when passed through my php exec() function the .htpasswd
>file does not change. I'm not getting any errors, but I'm not getting
>any action either.

How did you invoke htpasswd? htpasswd on UNIX tends to prompt on
/dev/tty, *NOT* stdin, which means that if you tried sending in
the password on stdin, it won't work. Maybe Windows is trying
to get it from the console (and failing). Try putting all the info
needed on the command line (with the -b flag), if you aren't already.

>I'd really appreciate anything anyone could suggest - I feel like I'm
>banging my head against a wall here.

                                                Gordon L. Burditt
Received on Mon Oct 24 02:08:41 2005