PHP Patch open_basedir for dynamic virtualhost

This is a discussion on PHP Patch open_basedir for dynamic virtualhost within the PHP General forums, part of the PHP Programming Forums category; Hi all, it's a lot of time that i am trying to let Jason Greene open_basedir patch work with ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-07-2007
DoM
 
Posts: n/a
Default PHP Patch open_basedir for dynamic virtualhost

Hi all,
it's a lot of time that i am trying to let Jason Greene open_basedir
patch work with apache massive virtualhost.

This is direct link to patch when it was developed:
http://www.phpbuilder.com/lists/php-...00101/0994.php

This is a FreeBSD port more recent with same code:
http://lists.freebsd.org/pipermail/f...er/066983.html

If i set to open_basedir directive (inside virtualhost config section)
value VIRTUAL_DOCUMENT_ROOT, it works but i am not able to add static
path like /tmp/

This is an example:

VirtualDocumentRoot /var/www/php.net/%1
php_admin_value open_basedir VIRTUAL_DOCUMENT_ROOT

user test.php.net is chrooted for php scripts in his homedir but he
cannot write temporary files inside /tmp/

I tried with value %1; VIRTUAL_DOCUMENT_ROOT:/tmp/ and more but no way.

These are my apps version:

OS: Debian Sarge 3.1
Server version: Apache/2.0.54 (mpm-prefork pacchettizzata)
PHP: 4.4.6 (Source) & 5.2.1 (Source)

Any help will be useful and appreciated.

Thank you all


Regards

Reply With Quote
  #2 (permalink)  
Old 03-07-2007
Jim Lucas
 
Posts: n/a
Default Re: [PHP] PHP Patch open_basedir for dynamic virtualhost

DoM wrote:
> Hi all,
> it's a lot of time that i am trying to let Jason Greene open_basedir
> patch work with apache massive virtualhost.
>
> This is direct link to patch when it was developed:
> http://www.phpbuilder.com/lists/php-...00101/0994.php
>
> This is a FreeBSD port more recent with same code:
> http://lists.freebsd.org/pipermail/f...er/066983.html
>
> If i set to open_basedir directive (inside virtualhost config section)
> value VIRTUAL_DOCUMENT_ROOT, it works but i am not able to add static
> path like /tmp/
>
> This is an example:
>
> VirtualDocumentRoot /var/www/php.net/%1
> php_admin_value open_basedir VIRTUAL_DOCUMENT_ROOT
>
> user test.php.net is chrooted for php scripts in his homedir but he
> cannot write temporary files inside /tmp/
>
> I tried with value %1; VIRTUAL_DOCUMENT_ROOT:/tmp/ and more but no way.
>
> These are my apps version:
>
> OS: Debian Sarge 3.1
> Server version: Apache/2.0.54 (mpm-prefork pacchettizzata)
> PHP: 4.4.6 (Source) & 5.2.1 (Source)
>
> Any help will be useful and appreciated.
>
> Thank you all
>
>
> Regards
>
>

http://us3.php.net/manual/en/feature...i.open-basedir

Read the first line of the first paragraph.

/tmp/ is not with-in /var/www/php.net/%1 it is out side

But then read the fifth paragraph and you should have your solution.

--
Enjoy,

Jim Lucas

Different eyes see different things. Different hearts beat on different
strings. But there are times for you and me when all such things agree.

- Rush
Reply With Quote
  #3 (permalink)  
Old 03-07-2007
DoM
 
Posts: n/a
Default Re: [PHP] PHP Patch open_basedir for dynamic virtualhost

Jim Lucas wrote:
> http://us3.php.net/manual/en/feature...i.open-basedir
>
> Read the first line of the first paragraph.
>
> /tmp/ is not with-in /var/www/php.net/%1 it is out side


Yes, of course i know this :)

As i wrote i would like to include static path after dynamic path like
/var/www/php.net/%1
( i remember you that i know i could assign dynamic open_basedir value
such as /var/www/php.net/%1/ or VIRTUAL_DOCUMENT_ROOT only with Jason
Greene patch)

I mean something like this:
/var/www/php.net/%1/:/tmp/:/usr/local/xxx/ and so on.

> But then read the fifth paragraph and you should have your solution.
>


If you mean this:
The restriction specified with open_basedir is actually a prefix, not a
directory name. This means that "open_basedir = /dir/incl" also allows
access to "/dir/include" and "/dir/incls" if they exist. When you want
to restrict access to only the specified directory, end with a slash.
For example: "open_basedir = /dir/incl/"

i tell you that i do not want an open_basedir value just like
/var/www/php.net/%1/ where /var/www/php.net/tmp/ is the answer cause
then all users (%1) inside /var/www/php.net/ can access their homedir
each other.

I do not know if i understand what you mean but i hope no and hope that
i am wrong, so i could hope in a solution :)

Anyway thanks to be interested about my problem.

Waiting for your reply.


Regards

Reply With Quote
  #4 (permalink)  
Old 03-07-2007
Jim Lucas
 
Posts: n/a
Default Re: [PHP] PHP Patch open_basedir for dynamic virtualhost

DoM wrote:
> Jim Lucas wrote:
>> http://us3.php.net/manual/en/feature...i.open-basedir
>>
>> Read the first line of the first paragraph.
>>
>> /tmp/ is not with-in /var/www/php.net/%1 it is out side

>
> Yes, of course i know this :)
>
> As i wrote i would like to include static path after dynamic path like
> /var/www/php.net/%1
> ( i remember you that i know i could assign dynamic open_basedir value
> such as /var/www/php.net/%1/ or VIRTUAL_DOCUMENT_ROOT only with Jason
> Greene patch)
>
> I mean something like this:
> /var/www/php.net/%1/:/tmp/:/usr/local/xxx/ and so on.

does this work?

The manual says it should.

>
>> But then read the fifth paragraph and you should have your solution.
>>

>
> If you mean this:
> The restriction specified with open_basedir is actually a prefix, not a
> directory name. This means that "open_basedir = /dir/incl" also allows
> access to "/dir/include" and "/dir/incls" if they exist. When you want
> to restrict access to only the specified directory, end with a slash.
> For example: "open_basedir = /dir/incl/"


Nope, that was the sixth paragraph.

>
> i tell you that i do not want an open_basedir value just like
> /var/www/php.net/%1/ where /var/www/php.net/tmp/ is the answer cause
> then all users (%1) inside /var/www/php.net/ can access their homedir
> each other.

I did not understand this last statement.

How would you get
/var/www/php.net/tmp/
from
/var/www/php.net/%1/:/tmp/

>
> I do not know if i understand what you mean but i hope no and hope that
> i am wrong, so i could hope in a solution :)
>
> Anyway thanks to be interested about my problem.
>
> Waiting for your reply.
>
>
> Regards
>
>



--
Enjoy,

Jim Lucas

Different eyes see different things. Different hearts beat on different
strings. But there are times for you and me when all such things agree.

- Rush
Reply With Quote
  #5 (permalink)  
Old 03-07-2007
DoM
 
Posts: n/a
Default Re: [PHP] PHP Patch open_basedir for dynamic virtualhost

Jim Lucas wrote:
> DoM wrote:
>> I mean something like this:
>> /var/www/php.net/%1/:/tmp/:/usr/local/xxx/ and so on.

> does this work?
>
> The manual says it should.


And it works for static path like /tmp/:/var/www/: but not for dynamic
path like /var/www/%0/%1 .
I need Jason Greene patch to let it work with dynamic path and
mod_vhost_alias apache.

http://www.phpbuilder.com/lists/php-...00101/0994.php


Regards

Reply With Quote
  #6 (permalink)  
Old 03-09-2007
DoM
 
Posts: n/a
Default Re: [PHP] PHP Patch open_basedir for dynamic virtualhost

DoM wrote:
> Hi all,
> it's a lot of time that i am trying to let Jason Greene open_basedir
> patch work with apache massive virtualhost.
>
> This is direct link to patch when it was developed:
> http://www.phpbuilder.com/lists/php-...00101/0994.php
>
> This is a FreeBSD port more recent with same code:
> http://lists.freebsd.org/pipermail/f...er/066983.html
>
> If i set to open_basedir directive (inside virtualhost config section)
> value VIRTUAL_DOCUMENT_ROOT, it works but i am not able to add static
> path like /tmp/
>
> This is an example:
>
> VirtualDocumentRoot /var/www/php.net/%1
> php_admin_value open_basedir VIRTUAL_DOCUMENT_ROOT
>
> user test.php.net is chrooted for php scripts in his homedir but he
> cannot write temporary files inside /tmp/
>
> I tried with value %1; VIRTUAL_DOCUMENT_ROOT:/tmp/ and more but no way.
>
> These are my apps version:
>
> OS: Debian Sarge 3.1
> Server version: Apache/2.0.54 (mpm-prefork pacchettizzata)
> PHP: 4.4.6 (Source) & 5.2.1 (Source)
>
> Any help will be useful and appreciated.
>


Does anyone know something about that ?


Regards


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:24 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0