[chora] Followup (Re: "Can't check path...")

Chuck Hagenbuch chuck at horde.org
Sun Nov 12 18:02:11 PST 2006


Quoting Eric <spamsink at scoot.netis.com>:

> In any case, $dir returned non-NULL, so I assume that the popen()  
> call completed without error (valid assumption?).

The system call? Yes. What it executed? No.

> (One question ... If I leave both of those var_dump() calls in  
> place, I get "string(74) "/usr/bin/svn ls  
> 'file:///usr/local/svnroot/repos/MyRepo/' 2>&1" resource(55) of type  
> (stream)".  How do I tell it to insert a newline in between the two  
> calls to var_dump(), to make the output a little easier to read?  On  
> a hunch I added "\n" at the end of the first var_dump, as in  
> var_dump($cmd, "\n");, also tried var_dump("\n", $cmd);, but neither  
> of those did it.)

You just need to realize you're outputting HTML here. So a linebreak  
is <br />.

> I get:
>
>   string(60) "svn: Can't check path '/root/.subversion':
>                            Permission denied" string(0) ""
> (... all on one line.)
>
> So, somewhere between line 317 and line 323 it seems to have gotten  
> the idea that I wanted to look at /root/.subversion.  But, I can't  
> find anything or any indication that would account for that.  In  
> particular, there is nothing in  
> file:///usr/local/svnroot/repos/MyRepo that would point to root.

Are you _sure_ that the environment for apache doesn't have any of  
root's env vars? Because this has nothing to do with those lines of  
code. The "can't check path" string is the output of the svn command  
that we tried to run - as the apache user.

So one thing you should try is running:
/usr/bin/svn ls 'file:///usr/local/svnroot/repos/MyRepo/' 2>&1

Then you should make absolutely sure that you're using the exact same  
environment that apache (www-data, whatever) has when the PHP script  
tries the same command.

> Don't know where to go from here, unless popen() really is only  
> supposed to be fed the path and not the whole command string, in  
> which case I'd have to ask how it has worked for anyone else.

Good question.

-chuck

-- 
"we are plastered to the windshield of the bus that is time." - Chris


More information about the chora mailing list