Problem/Motivation
In the event that {system} reports a module being enabled, and that module is removed from the filesystem improperly, _advanced_help_parse_ini begins a file_scan_directory of "./", including one's entire "files" directory. Symptoms: admin/modules page takes forever to load or times-out if there is a large directory tree within the docroot.
I believe this can be reproduced by:
1. Install & Enable Advanced Help and Devel
2. Place huge directory tree in sites/default/files
3. delete Devel from the filesystem without disabling it
4. Visit admin/modules - the larger the tree in sites/default/files, the longer the page load will be
Proposed resolution
The attached patch checks to see that $module_path is something before attempting any operations with it. If $module_path is not found, it reports the offending module to watchdog.
Remaining tasks
Needs review
User interface changes
None.
API changes
None known.
Comment | File | Size | Author |
---|---|---|---|
#3 | advanced_help-fix_file_scan_directory-1293110-3.patch | 655 bytes | andershal |
advanced_help-prevent_docroot_scans.patch | 2.54 KB | Jonathan Webb |
Comments
Comment #1
petsagouris CreditAttribution: petsagouris commentedComment #2
JacobSingh CreditAttribution: JacobSingh commentedTo reproduce this, you could symlink from your files directory to the / (root) of your system causing a massive directory scan.
Comment #3
andershal CreditAttribution: andershal commentedI have another fix for what I think is the same problem.
The Drupal 7 version of advanced_help uses the old Drupal 6 file_scan_directory() parameters. Therefore there is a complete recursive traversing through all folders of our multisite setup - including all files!
Patch for branch 7.x-1.x attached.
Comment #4
buddaWe've found the same problem this week. Good to see we're not alone with the file_scan_directory() parameters observation!
Comment #5
mikebell_ CreditAttribution: mikebell_ commentedTested patch from comment 3 and it works well.
Comment #6
buddaAgreed - patch in comment 3 fixed the problem. Tested and deployed to the production server and no more recursion on the server!
Comment #7
amitgoyal CreditAttribution: amitgoyal commentedThanks all!! Moved into 7.x-1.x-dev.