#43417 closed defect (bug) (fixed)
Infinite loop in wp_mkdir_p with open_basedir restrictions
| Reported by: | 1265578519 | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.9.5 |
| Component: | Filesystem API | Version: | 3.7 |
| Severity: | normal | Keywords: | has-patch fixed-major |
| Cc: | Focuses: |
Attachments (1)
Change History (11)
#1
@
8 years ago
- Component Canonical → Filesystem API
- Summary upstream protocol header size is too big → Infinite loop in wp_mkdir_p with open_basedir restrictions
#2
@
8 years ago
- Keywords has-patch needs-unit-tests added
The test is tough to write, once ini_set is called the whole test suite breaks. Plus the test can't fail, because it's in an infinite loop, it can only pass.
<?php /** * @ticket 43417 */ public function test_wp_mkdir_p_loop() { ini_set( 'open_basedir', '/no/exists/ever' ); // suppress open_basedir restriction errors @wp_mkdir_p( '/tmp/try/his' ); ini_restore( 'open_basedir' ); }
#5
@
8 years ago
Didn't think I'd ever encounter this, but I just saw this happen on a migrated client site via a call to wp_upload_dir from Divi theme, where the et_images_temp_folder option was not replaced correctly.
An incorrect/badly formed upload_path would also get into an infinite loop. So this is not a theoretical scenario, this actually happens :(
Patch got rid of infinite loop in wp_mkdir_p call.
Any ideas on how to automate test for this? Or can this be merged without unit tests due to it being so dangerous to test?
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)


It's an infinite loop :D to reproduce: