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

File System Repository silently obeys maximum file size

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Test 1, and 2

      1. Repeat the test from MDL-44626
      2. Repeat the test from MDL-54110

      Test 3

      1. Login as admin
      2. Go to "Site administration > Courses > Restore course"
      3. Try uploading (with and without drag and drop) a backup file larger than post_max_size, you should get an error
      4. Select a file larger than the post_max_size from the file system repository
      5. Submit the form
      6. Confirm that the backup was restored
      7. Login as a user that doesn't have moodle/course:ignorefilesizelimits
      8. Try restoring a larger course than post_max_size using:
        • Upload via drag and drop
        • Upload without drag and drop
        • Using the File System repository
      9. Confirm that you cannot
      10. Confirm that it works fine with a smaller file
      Show
      Test 1, and 2 Repeat the test from MDL-44626 Repeat the test from MDL-54110 Test 3 Login as admin Go to "Site administration > Courses > Restore course" Try uploading (with and without drag and drop) a backup file larger than post_max_size , you should get an error Select a file larger than the post_max_size from the file system repository Submit the form Confirm that the backup was restored Login as a user that doesn't have moodle/course:ignorefilesizelimits Try restoring a larger course than post_max_size using: Upload via drag and drop Upload without drag and drop Using the File System repository Confirm that you cannot Confirm that it works fine with a smaller file
    • Affected Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-54785-master
    • Sprint:
      3.2 Sprint 2

      Description

      The easiest way to show this is using restore as admin from Site admin > Courses > Restore (ie Site context).

      1. Generate or find a reasonably large backup file.
      2. Set up a file system repository
      3. Set up php.ini to have a maximum file size / post size of less than the backup file
      4. Copy the backup file to the FSR folder on the server
      5. Attempt to restore the file by grabbing it in the repository
      6. It will fail saying the file is invalid
      7. Increase php.ini settings to make the maximum file size larger than the backup / restart as required
      8. Try the restore again
      9. It works!

      It appears that the file is getting truncated somewhere and so is corrupt. This is new - certainly since 2.9

      I imagine this is related to MDL-44626 and MDL-54110, but I am logged in as the primary admin so, surely, any relevant capabilities will not apply anyway.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Jul/16