[wp-trac] [WordPress Trac] #31767: insert_with_markers() is not atomic, leading to corrupted .htaccess updates under race conditions

WordPress Trac noreply at wordpress.org
Mon Oct 19 00:52:10 UTC 2015


#31767: insert_with_markers() is not atomic, leading to corrupted .htaccess updates
under race conditions
-----------------------------------+-----------------------
 Reporter:  tigertech              |       Owner:  dd32
     Type:  defect (bug)           |      Status:  assigned
 Priority:  normal                 |   Milestone:  4.4
Component:  Filesystem API         |     Version:  4.1.1
 Severity:  critical               |  Resolution:
 Keywords:  4.4-early needs-patch  |     Focuses:
-----------------------------------+-----------------------

Comment (by dd32):

 In [changeset:"35267"]:
 {{{
 #!CommitTicketReference repository="" revision="35267"
 In `insert_with_markers()` restore the 4.3 behaviour of creating the file
 if it doesn't exist.
 This change also makes it bail early (without writing) if the markers
 content is the same as the existing, and uses `ftell()` rather than
 `$bytes` for the location to truncate the file to - based on the file
 pointer being at the end of the written stream.

 Props willmot tigertech kevinatelement
 See #31767
 }}}

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


More information about the wp-trac mailing list