I was building an app on a SUSE box, and had a binary called
create_group for instance, which had a suid bit and allowed my PHP app to call
exec('create_group grpname'); and create a new group (there are others for users, etc).
The binary was a small c script that calls
setuid(0) and then runs the user creation stuff. This worked perfectly on the SUSE box
I recently moved my project to Ubuntu and everything works fine except these binaries. I can run them from the shell and they work okay, but when I get the PHP app to run them it just does nothing. Is there anything Ubuntu would be doing differently that I'm missing?
UPDATE: I've tried running one of my binaries called
create_group which is essentially a
groupadd wrapper, works fine from command line. When I run it in PHP and then check the apache errors logs, I have the following message:
sh: groupadd: not found
Any ideas on why this would be?