[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
Thu Oct 1 07:47:25 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:  has-patch 4.4-early  |     Focuses:
---------------------------------+-----------------------

Comment (by dd32):

 [34740] is my attempt at handling this using `flock()`.

 So far in testing, I'm able to consistently duplicate file corruption
 before the patch, and also when locking isn't available.
 Unfortunately we can't use a second temporary file in a lot of cases, so I
 decided against using an atomic file move.

 Leaving this open to see if there's any other suggestions we could go
 down, or if any bugs crop up (please test)

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


More information about the wp-trac mailing list