[wp-trac] [WordPress Trac] #51340: Stop chmodding files and folders

WordPress Trac noreply at wordpress.org
Sat Mar 11 03:53:52 UTC 2023


#51340: Stop chmodding files and folders
----------------------------+------------------------------
 Reporter:  malthert        |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Filesystem API  |     Version:  5.3
 Severity:  major           |  Resolution:
 Keywords:  dev-feedback    |     Focuses:
----------------------------+------------------------------
Changes (by costdev):

 * keywords:   => dev-feedback


Comment:

 There appear to be at least three paths forward here:

 1. Stop using `chmod()` altogether.
   - This would rely on server admins implementing umask properly and, I
 imagine, cause quite a bit of disruption until resolved.
 2. Add back error suppression for `chmod()` calls.
   - This goes against the aim of reducing error suppression as much as
 possible in Core. It may not be desirable, even though this ticket offers
 use cases where error suppression would be helpful.
 3. A constant, or filter, that allows server admins to disable `chmod()`
 calls.
   - The `::chmod()` method in the filesystem abstraction classes could
 check this value, and return `true` immediately. This would allow `if (
 $wp_filesystem->chmod() ) {}` checks to pass while avoiding the `chmod()`
 calls on such systems mentioned earlier in this ticket.
   - A quick search shows there are ~12 instances of `chmod()` outside of
 the `::chmod()` methods in Core.

 Given the above, I'd welcome thoughts on the preferred path forward.
 Adding `dev-feedback` to gather thoughts on these as well as additional
 ideas.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51340#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list