Re: chown help please!
| From: | prgr at u5 dot com | Date: | Sun, 08 Oct 2000 01:59:48 +0000 |
| Subject: | Re: chown help please! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-19064@lists.php.net to get a copy of this message | ||
Hi,
in my man-page for chown it says:
"The ownership of a file may only be altered by a super-user for obvious
security reasons."
Makes sense. So if Apache runs the visitor under user "nobody", files and
dirs created will be owned by "nobody" and that can't be changed from within
the script.
If you are on a shared server where everybody else also have Apache running
under "nobody" it means that everybody elses scripts on the server also will
have potential access to both your PHP-scripts and the generated files. A
problem for which I only know one solution:
Run under "cgiwrap". That allows you to run scripts (e.g. PHP) under your
own user name and thus files and dirs will have that name too. But this can
only work under the CGI-version of PHP.
Pair Networks (pair.com) supports this well, there are surely many other
providers too.
Apache's "suexec" might provide the same solution (even in the module
version of PHP ?) but I have never tried that.
Best regards
Soren "Frank"
U5 UK Ltd.
At 14:38 7/10/00 -0500, you wrote:
>...If php creates a folder as nobody (mkdir
>folder), how on earth do I also have php change the owner to be me? I have
>tried 'chown myusername folder' but that doesn't work.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DSA Co., Ltd.
leading in Information Processing.
e-mail: dsa@trv.net
Tel: +66-76-340 584
Fax: +66-76-341 334
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~