Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-43137

class loader breaks open_basedir

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 2.6.1, 2.7
    • 2.6
    • Libraries
    • MOODLE_26_STABLE
    • MOODLE_26_STABLE, MOODLE_27_STABLE
    • w50_MDL-43137_m27_openbasedir
    • Hide

      do not use open_basedir

      Show
      do not use open_basedir
    • Hide

      1/ enable open_basedir - such as adding this to your config.php:
      ini_set('open_basedir', _DIR_.':'.$CFG->dataroot.':'.$CFG->behat_dataroot.':'.$CFG->phpunit_dataroot);
      2/ try installation with existing config.php (==change db prefix) and upgrade from 2.5
      3/ check error log - there should not be any open_basedir related problems

      Show
      1/ enable open_basedir - such as adding this to your config.php: ini_set('open_basedir', _ DIR _.':'.$CFG->dataroot.':'.$CFG->behat_dataroot.':'.$CFG->phpunit_dataroot); 2/ try installation with existing config.php (==change db prefix) and upgrade from 2.5 3/ check error log - there should not be any open_basedir related problems
    • 2
    • BACKEND Sprint 7

    Description

      Looking at lib/classes/component.php the function load_classes() makes a quick check that the $fulldir parameter is valid by calling is_dir($fulldir). Unfortunately, this breaks if open_basedir is enabled as it is checking paths like /classes which will trigger the open_basedir restriction and cause Moodle to fail.

      Would it not be better to do a comparison with $CFG->dirroot to see if $fulldir looks like a valid, absolute path?

      More details in https://moodle.org/mod/forum/discuss.php?d=244818.

      Attachments

        Activity

          People

            skodak Petr Skoda (Inactive)
            howardsmiller Howard Miller
            Dan Poltawski Dan Poltawski
            Marina Glancy Marina Glancy
            Adrian Greeve Adrian Greeve
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Clockify

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.