open_base_dir and apache vhosts

php.internals

Edin Kadribasic

23 years ago
Hi Rasmus, There are several people who are reporting on the bugs site that if you enable open_base_dir on 1 vhost it affects all vhosts in PHP ever since 4.2.2. Didn't you report that this issue was solved? Edin

Robin Ericsson

23 years ago
On Wed, 2003-05-07 at 10:23, Edin Kadribasic wrote:
> Hi Rasmus, > > There are several people who are reporting on the bugs site that if > you enable open_base_dir on 1 vhost it > affects all vhosts in PHP ever since 4.2.2. Didn't you report that > this issue was solved?
We are using 4.3.1 and haven't noticed this problem on apache 1.3.27 and FreeBSD. We have at least 20+ vhosts using open_basedir.
-- Robin Ericsson Profecta HB http://www.profecta.se/ http://www.prisbevakaren.net/

Edin Kadribasic

23 years ago
On 7 May 2003, Robin Ericsson wrote:
> We are using 4.3.1 and haven't noticed this problem on apache 1.3.27 and > FreeBSD. > > We have at least 20+ vhosts using open_basedir.
The report is that vhosts that don't have open_basedir restriction also acquire it from other vhosts. Do you have any vhost without open_basedir? Edin

Robin Ericsson

23 years ago
On Wed, 2003-05-07 at 10:49, Edin Kadribasic wrote:
> On 7 May 2003, Robin Ericsson wrote: > > > We are using 4.3.1 and haven't noticed this problem on apache 1.3.27 and > > FreeBSD. > > > > We have at least 20+ vhosts using open_basedir. > > The report is that vhosts that don't have open_basedir restriction also > acquire it from other vhosts. Do you have any vhost without open_basedir?
On the server I checked we have 15 vhosts with open_basedir and another 60 vhosts not using open_basedir, and we haven't noticed any problems. As we haven't heard anything from our customers, I guess they haven't noticed anything either :)
-- Robin Ericsson Profecta HB http://www.profecta.se/ http://www.prisbevakaren.net/

Rasmus Lerdorf

23 years ago
On Wed, 7 May 2003, Edin Kadribasic wrote:
> There are several people who are reporting on the bugs site that if > you enable open_base_dir on 1 vhost it > affects all vhosts in PHP ever since 4.2.2. Didn't you report that > this issue was solved?
It should be fine in the current CVS

Edin Kadribasic

23 years ago
On Wed, 7 May 2003, Rasmus Lerdorf wrote:
> On Wed, 7 May 2003, Edin Kadribasic wrote: > > There are several people who are reporting on the bugs site that if > > you enable open_base_dir on 1 vhost it > > affects all vhosts in PHP ever since 4.2.2. Didn't you report that > > this issue was solved? > > It should be fine in the current CVS
I've just seen it happening as described in #23504. It took some reloading but sure it appeared. Seems to be related to #23462. Edin

Rasmus Lerdorf

23 years ago
On Wed, 7 May 2003, Edin Kadribasic wrote:
> On Wed, 7 May 2003, Rasmus Lerdorf wrote: > > > On Wed, 7 May 2003, Edin Kadribasic wrote: > > > There are several people who are reporting on the bugs site that if > > > you enable open_base_dir on 1 vhost it > > > affects all vhosts in PHP ever since 4.2.2. Didn't you report that > > > this issue was solved? > > > > It should be fine in the current CVS > > I've just seen it happening as described in #23504. It took some reloading > but sure it appeared. Seems to be related to #23462.
Then theoretically you should see it with any directive. open_basedir is handled by the same code that does all the other string directives. I see no significant changes between 4.2 and 4.3 in the sapi/apache/mod_php4.c file. Just some Netware stuff and changing a bunch of functions to be static. There were some changes in Zend/zend_ini.c between the two versions which I suppose could be causing this. What happens if you reverse this patch: http://cvs.php.net/diff.php/Zend/zend_ini.c?login=2&r1=1.22&r2=1.23&ty=u Can you still make it happen? -Rasmus

Edin Kadribasic

23 years ago
On Wed, 7 May 2003, Rasmus Lerdorf wrote:
> On Wed, 7 May 2003, Edin Kadribasic wrote: > > > On Wed, 7 May 2003, Rasmus Lerdorf wrote: > > > > > On Wed, 7 May 2003, Edin Kadribasic wrote: > > > > There are several people who are reporting on the bugs site that if > > > > you enable open_base_dir on 1 vhost it > > > > affects all vhosts in PHP ever since 4.2.2. Didn't you report that > > > > this issue was solved? > > > > > > It should be fine in the current CVS > > > > I've just seen it happening as described in #23504. It took some reloading > > but sure it appeared. Seems to be related to #23462. > > Then theoretically you should see it with any directive. open_basedir is > handled by the same code that does all the other string directives. I see > no significant changes between 4.2 and 4.3 in the sapi/apache/mod_php4.c > file. Just some Netware stuff and changing a bunch of functions to be > static. There were some changes in Zend/zend_ini.c between the two > versions which I suppose could be causing this.
The difference is that its the script itself that php refuses to load so it happens before the execution starts.
> What happens if you reverse this patch: > > http://cvs.php.net/diff.php/Zend/zend_ini.c?login=2&r1=1.22&r2=1.23&ty=u > > Can you still make it happen?
I was unable to reproduce this myself but I have seen it happen on the box described in #23504. That chap is helping me find out if a slight code sequence change in mod_php4.c can help the issue. So far so good. Edin

Edin Kadribasic

23 years ago
On Wed, 7 May 2003, Edin Kadribasic wrote:
> I was unable to reproduce this myself but I have seen it happen on the box > described in #23504. That chap is helping me find out if a slight code > sequence change in mod_php4.c can help the issue. So far so good.
Please test attached patch which applies per dir configuration before opening file before I commit it. The user reports that it solves the problem for him. Edin

Rasmus Lerdorf

23 years ago
On Wed, 7 May 2003, Edin Kadribasic wrote:
> On Wed, 7 May 2003, Edin Kadribasic wrote: > > > I was unable to reproduce this myself but I have seen it happen on the box > > described in #23504. That chap is helping me find out if a slight code > > sequence change in mod_php4.c can help the issue. So far so good. > > Please test attached patch which applies per dir configuration before > opening file before I commit it. The user reports that it solves the > problem for him.
Ah, that does make sense. That looks like it is correct. I don't have time to test it right now. -Rasmus