WordPress.org

Make WordPress Core

#25771 closed defect (bug) (fixed)

Only check for is_writable() pre-update for the files to which we need to write

Reported by: nacin Owned by: dd32
Milestone: 3.7.2 Priority: normal
Severity: normal Version:
Component: Upgrade/Install Keywords: has-patch fixed-major commit
Focuses: Cc:

Description

Before an update, we check the entire list of files in WordPress, based on a list of all checksums, to see if any need changing. If so, we then check to see if the file is writable. The files_not_writable error code occurs when a file we've determined we need to copy over is not writable, even after chmod 0644.

dd32 and I noticed an error condition where an incomplete update to 3.7 resulted in some about page image files not being created in wp-admin/images. For 3.7.1, files_not_writable was thrown because the checksums did not match for those files. But since a partial build was being used, there was no file to actually copy over in the working directory, even if we could write to it.

We should only perform is_writable() pre-update checks for files to which we need to write. If something goes wonky during a previous update, we can try to make sure that doesn't affect a partial build update to 3.7.1.

Attachments (1)

25771.diff (1.4 KB) - added by nacin 21 months ago.

Download all attachments as: .zip

Change History (5)

@nacin21 months ago

comment:1 @dd3221 months ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 26014:

When checking filesystem permissions for core updates, only check the permissions of the files which we need to alter. Props nacin for initial patch. Fixes #25771 for trunk

comment:2 @dd3221 months ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Still needs back porting

Slight change made, it needed to skip it in a 2nd place, and I synced the wp-content check style in both, we can probably leave out that change for the 3.7 branch.

comment:3 @dd3221 months ago

  • Keywords commit added

comment:4 @nacin16 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 27882:

When checking filesystem permissions for core updates, only check the permissions of the files which we need to alter.

Merges [26014] from 3.8 to the 3.7 branch.

fixes #25771.

Note: See TracTickets for help on using tickets.