PHP 4.2 Needs To Call Wget

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have an RH9 Linux PHP 4.2.2 web page that I need to call a Bash file
under the context of root and do the wget command to download a file,
clobbering the previous download of this same filename. It's bombing
without leaving any trace. I tried introducing all manner of chmod,
chown, sudo, and sticky bit, but this fails. The only thing I see in
the syslog is failed sudo authenticaiton for user Apache. What's the
technique to get this working?

Re: PHP 4.2 Needs To Call Wget

Perhaps the apache user isn't in the list of sudo'ers?  Although it is
kind of scary that you have a webpage on the internet trying to execute
things as root on the local machine...

Re: PHP 4.2 Needs To Call Wget

ZeldorBlat wrote:
Quoted text here. Click to load it

It's an intranet server behind 3 firewalls and a personal firewall on
the system. The web page is for entry-level sysops to conduct a data
task. I tried the /etc/sudoers approach, which works in most other
cases, but doesn't seem to work in this case.

Last night the only resolution I found was to flip the sticky bit on
the /usr/bin/wget program with:

chown root.root /usr/bin/wget (this was already done on install of
chmod u+s /usr/bin/wget

That seemed to fix the problem for now, although sticky bit techniques
are not recommended by higher ups at my company.

Site Timeline