I am trying to write a script that will create a fill and then change the ownership to someone else. However, I keep getting an error (using the chown function) and I am guessing it is because PHP is not running as a superuser. Does anyone know how to set PHP to run as a superuser? Or any other suggestions which may get this working? Thanks for the help!
Jul 16, 2003, 9:24 AM
Veteran / Moderator (17364 posts)
Jul 16, 2003, 9:24 AM
Post #2 of 6
Views: 899
Is that a good idea? It would open up a *huge* security risk in your server :-/
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Jul 16, 2003, 1:53 PM
User (425 posts)
Jul 16, 2003, 1:53 PM
Post #3 of 6
Views: 887
What error message are you getting? Can you post your code, please?
Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
Jul 16, 2003, 2:06 PM
Veteran / Moderator (17364 posts)
Jul 16, 2003, 2:06 PM
Post #4 of 6
Views: 885
I wasn't even aware that you could CHOWN a file with PHP. mkdir(), chmod(), rmdir(), and other's, but not chown()
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Jul 16, 2003, 2:10 PM
User (425 posts)
Jul 16, 2003, 2:10 PM
Post #5 of 6
Views: 888
Yep - http://www.php.net/chown
But PHP does have to run with superuser permissions, which, I agree, creates some security concerns.
Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
But PHP does have to run with superuser permissions, which, I agree, creates some security concerns.
Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
Jul 17, 2003, 9:12 AM
Administrator (9387 posts)
Jul 17, 2003, 9:12 AM
Post #6 of 6
Views: 864
Hi,
You would need to either:
a. Run apache as root (very bad idea and apache won't let you do this unless you recompile it with a special flag).
b. Run your PHP via CGI that is setuid root. Could be a big exploit waiting to happen if you don't lock it down properly.
Cheers,
Alex
--
Gossamer Threads Inc.
You would need to either:
a. Run apache as root (very bad idea and apache won't let you do this unless you recompile it with a special flag).
b. Run your PHP via CGI that is setuid root. Could be a big exploit waiting to happen if you don't lock it down properly.
Cheers,
Alex
--
Gossamer Threads Inc.

