Results 1 to 1 of 1
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Mar 2007
Running Administrative Services from PHP
This PHP page uses a class that I wrote to manipulate both the DHCP lease file, and configuration file. When the end user visits this page, and agrees to the terms, their hardware address is resolved by comparing their IP address to the DHCP lease file. Finally, this information is used to write a new host declaration into the dhcp configuration file, thus allowing them into the authenticated subnet.
Everything described above works exactly as planned; however, my problem is applying these changes. I need a way for the user that owns the web server (in my case "www-data") to be able to restart dhcp.
The restart process is a simple shell script that kills the pid, and removes the file containing the pid, both of these task require elevated privileges that i do not want to give to the user "www-data."
As the restart script is well... a script, setting the suid bit does not work. To my knowledge, the only way to do what I have in mind is to compile an executable, make its owner "root", and then set the suid bit on it.
Unfortunately, I haven't the slightest idea on how make bash (or any other shell for that matter) execute a script from a C program. Any help on this subject would be very helpful. Thanks.