[mythtv-commits] Ticket #7997: open_basedir error due to module loading bug

MythTV mythtv at cvs.mythtv.org
Sat Jan 30 23:30:13 UTC 2010

#7997: open_basedir error due to module loading bug
 Reporter:  christian.bachert@…          |       Owner:  kormoc 
     Type:  defect                       |      Status:  new    
 Priority:  minor                        |   Milestone:  unknown
Component:  Plugin - MythWeb             |     Version:  unknown
 Severity:  medium                       |     Mlocked:  0      

 I already saw the 2 similar bugs that won't get fixed, but I believe that
 the code is still faulty. Have a look at the thrown message:
 "Warning at /srv/http/mythweb/classes/Modules.php, line 30:
 file_exists(): open_basedir restriction in effect.
 '''File(./modules/welcome.php/init.php)''' is not within the allowed
 path(s): (/srv/http)

 In fact, the file ./modules/welcome.php/init.php is nonexistent.
 Modules.php makes a list of files in the modules directory, assumes they
 are subdirectories and tries to load init.php in each of the directories.
 welcome.php isn't a directory, hence you shouldn't treat it as one.

 Here's a cheap fix:
 In includes/utils.php is a function called get_sorted_files. Replace

 if ($file == '.' || $file == '..') continue;
 if ($file == '.' || $file == '..' || $file == 'welcome.php') continue;

 Probably there's someone that can do a lot better than this, but this did
 it for me.

Ticket URL: <http://svn.mythtv.org/trac/ticket/7997>
MythTV <http://www.mythtv.org/>

More information about the mythtv-commits mailing list