#61834 closed defect (bug) (fixed)
class-wp-site-health-auto-updates.php triggers error when basedir restrictions in effect
| Reported by: | Keffr3n | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.7 |
| Component: | Filesystem API | Version: | 6.6.1 |
| Severity: | normal | Keywords: | has-patch needs-testing |
| Cc: | Focuses: |
Description
Hello, for security reasons, the php pools serving my wordpress instances are isolated with open_basedir directive.
For site example.com, it's basedir is fixed to /www/example.com.
But in class-wp-site-health-auto-updates.php, paths outside this directory are tested: /.git, /www/.git and this throws errors.
instead of testing with is_dir, could you test also for access? like with is_readable()?
Attachments (1)
Change History (7)
This ticket was mentioned in PR #7153 on WordPress/wordpress-develop by @narenin.
2 years ago
#1
- Keywords has-patch added
#2
@
2 years ago
- Focuses php-compatibility removed
- Keywords needs-testing added; changes-requested removed
#4
in reply to: ↑ description
@
2 years ago
Hi there, thanks for the ticket! I was able to reproduce the issue. For anyone testing, note that the warning here may not be displayed on screen due to this test being performed via a REST API request, for which display_errors is off by default in wp_debug_mode(), so make sure to check the error log.
Replying to Keffr3n:
instead of testing with is_dir, could you test also for access? like with is_readable()?
In my testing, is_readable() appears to throw the same warning. However, we did resolve a similar issue previously in [55425] / #42619, so we can reuse WP_Automatic_Updater::is_allowed_dir() here.
@SergeyBiryukov commented on PR #7153:
2 years ago
#6
Thanks for the PR! Merged a slightly different approach in r58921.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Trac ticket: https://core.trac.wordpress.org/ticket/61834