[pmwiki-users] Bug report & fix proposal: fixperms may run into open_basedir restriction

Joachim Durchholz jo at durchholz.org
Mon Oct 24 12:57:19 CDT 2005


Hi,

I'm not sure whether this has already been fixed (the site is still
running 2.0beta34), but I'll report anyway.

In pmwiki.php, routine fixperms() checks the file owner of the current
directory (which also happens to be the PmWiki installation directory
unless things are set up in a *really* unusual way).

Now if Safe Mode is activated, and the installation directory itself is
listed in the open_basedir directive, PHP won't allow accessing the
directory, only objects within it. IOW the calls to fileowner('.') and
filegroup('.') fail due to the open_basedir restriction.

As a stopgap measure, I have fixed that by replacing fileowner('.') with
fileowner('pmwiki.php'), on the grounds that whoever installed PmWiki
may not even own the directory he installed into, but he will most
definitely own the pmwiki.php file inside it.
Comments welcome.

In case anybody wants to look at the site (with fix already in place,
drop me a note if you wish to see it fail): it's at http://maquaris.de . 
$EnableDiag is on, so ?action=diag etc. all work.

Regards,
Jo




More information about the pmwiki-users mailing list