Re: Howto Execute PHP as script owner/group without CGI?
| From: | chris smith | Date: | Wed, 22 Mar 2006 09:35:00 +0000 |
| Subject: | Re: Howto Execute PHP as script owner/group without CGI? | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-232403@lists.php.net to get a copy of this message | ||
On 3/22/06, Mathijs <m.v.veluw@smscity.nl> wrote:
> chris smith wrote:
> > On 3/22/06, Mathijs <m.v.veluw@smscity.nl> wrote:
> >> chris smith wrote:
> >>>> I Want to know if it is possible to execute PHP(5) as the owner/group of
> >>>> the script it self.
> >>>>
> >>>> At the moment saved files get owner and group nobody.
> >>>> When i upload through ftp, it gets the normal owner and group nobody..
> >>>>
> >>>> Is there a way that i can set both owner and group to
> >>>> 'myuser-groupname', and let apache or php execute it with that
> >>>> owner/group?
> >>> No. Only the 'root' user can change user/group.
> >>>
> >>> --
> >>> Postgresql & php tutorials
> >>> http://www.designmagick.com/
> >> That i know,
> >> But isn't there something like suexec or something for the apache module
> >> of php5 to let it execute as another user?
> >
> > Some hosts let you compile your own cgi version to use instead of the
> > main module and run everything through that instead of the apache
> > module.. not sure if that's an option for you.
> >
> > What problem are you trying to solve exactly?
> >
>
> for one, security.
> Now group has write access else apache/php can't write to any file.
> Group is nobody, and therefore everybody who has an virtual-host can
> access the files as group.
>
> PHP Safe-mode is on, but this doesn't stop perl/cgi.
>
> I want it so that owner and group are both 500 for example.
> Thisway i can set some files to public read only, and no one can access
> the files anymore except the user him self :).
I was going to suggest open_basedir restrictions might help but that
won't stop perl/cgi scripts either..
I think you're stuck :(
--
Postgresql & php tutorials
http://www.designmagick.com/