#43417 closed defect (bug) (fixed)
Infinite loop in wp_mkdir_p with open_basedir restrictions
Reported by: | 1265578519 | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.9.5 | Priority: | normal |
Severity: | normal | Version: | 3.7 |
Component: | Filesystem API | Keywords: | has-patch fixed-major |
Focuses: | Cc: |
Attachments (1)
Change History (11)
#1
@
7 years ago
- Component changed from Canonical to Filesystem API
- Summary changed from upstream protocol header size is too big to Infinite loop in wp_mkdir_p with open_basedir restrictions
#2
@
7 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
@
7 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?
#7
@
7 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 42801:
Note: See
TracTickets for help on using
tickets.
It's an infinite loop :D to reproduce: