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 (18436 posts)
Jul 16, 2003, 9:24 AM
Post #2 of 6
Views: 6669
Is that a good idea? It would open up a *huge* security risk in your server :-/
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Jul 16, 2003, 1:53 PM
User (425 posts)
Jul 16, 2003, 1:53 PM
Post #3 of 6
Views: 6670
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 (18436 posts)
Jul 16, 2003, 2:06 PM
Post #4 of 6
Views: 6683
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
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!

Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Jul 16, 2003, 2:10 PM
User (425 posts)
Jul 16, 2003, 2:10 PM
Post #5 of 6
Views: 6670
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: 6631
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.