psecio/iniscan

Support for open_basedir containing more then one paths set

mgrajcarek opened this issue · 4 comments

Currently, if you open_basedir contains more then one path, for example:

open_basedir="/var/www:/php/tmp_cache"

consraints included in CheckSoapWsdlCacheDir and CheckUploadTmpDir are not passing at:

    if ($openBasedir === false) {
        $this->setDescription('The open_basedir did not resolve to a valid directory');
        $this->fail();
        return false;
    }

due to realpath usage, which returns false for coma separated paths:

    $openBasedir = realpath($openBasedir);

The idea is to split $openBasedir by PATH_SEPARATOR into an array of $openBasedirPaths and to check each one of them against included rules.

The question is, how should I treat it. If one of paths === false, then should entire test fails? Or maybe all of them should be equal false?

What do you think about it? I can prepare tommorow appropriate patch.

Sorry for the delay responding here - I'm of the "fail fast" mentality. I think that if even one of the paths is invalid the entire test should fail. The error message should be updated in the case of multiple directories, however, to tell the user which one failed.

Ok. When I'll be back from holidays, I'll take care of it. Thanks for
response and shearing your work!
Cheers!

śr., 5 sie 2015, 03:30 Chris Cornutt użytkownik notifications@github.com
napisał:

Sorry for the delay responding here - I'm of the "fail fast" mentality. I
think that if even one of the paths is invalid the entire test should fail.
The error message should be updated in the case of multiple directories,
however, to tell the user which one failed.


Reply to this email directly or view it on GitHub
#89 (comment).

Hey @mgrajcarek, any update on this? Someone else mentioned it would be a nice feature to have too.

Hi @enygma.
Sorry for a delay. I was little bit busy after vacations and it slipped my mind.
I will start working on it from this evening.