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

core_files_zip_packer_testcase::test_list_files fails because of permissions

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.4, 3.1, 3.2
    • Fix Version/s: 3.0.7, 3.1.3
    • Component/s: Unit tests
    • Labels:
    • Testing Instructions:
      Hide

      # Make the files we don't want altered owned by root.  This will replicate the issue, because you aren't running your installation as root anyway. :)
      sudo chown root lib/filestorage/tests/fixtures
      sudo chown root lib/filestorage/tests/fixtures/empty.zip
      sudo chmod 444 lib/filestorage/tests/fixtures/empty.zip
       
      vendor/bin/phpunit lib/filestorage/tests/zip_packer_test.php
      

      Show
      # Make the files we don't want altered owned by root. This will replicate the issue, because you aren't running your installation as root anyway. :) sudo chown root lib/filestorage/tests/fixtures sudo chown root lib/filestorage/tests/fixtures/empty.zip sudo chmod 444 lib/filestorage/tests/fixtures/empty.zip   vendor/bin/phpunit lib/filestorage/tests/zip_packer_test.php
    • Affected Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Pull Master Branch:

      Description

      If user doesn't belong to same group who created moodle branch, /lib/filestorage/tests/fixtures/empty.zip then core_files_zip_packer_testcase::test_list_files fails because of permission problem.

      1) core_files_zip_packer_testcase::test_list_files
      file_put_contents(/var/www/html/moodle/lib/filestorage/tests/fixtures/empty.zip): failed to open stream: Permission denied
       
      /var/www/html/moodle/lib/filestorage/zip_archive.php:212
      /var/www/html/moodle/lib/filestorage/zip_packer.php:548
      /var/www/html/moodle/lib/filestorage/tests/zip_packer_test.php:131
      /var/www/html/moodle/lib/phpunit/classes/advanced_testcase.php:80
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/Nov/16