Opened 3 years ago

Last modified 4 months ago

#11903 accepted defect (bug)

insert_with_markers is not threadsafe — at Initial Version

Reported by: strings28 Owned by: ryan
Priority: normal Milestone: Future Release
Component: Permalinks Version: 2.9
Severity: major Keywords: needs-patch
Cc: strings28, retlehs

Description

From wp-admin/includes/misc.php the function insert_with_markers may be called multiple times on a busy server and if the htaccess is already in the process of being written it is possible that two PHP threads could attempt to write to it causing corruption such as the following:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
s

Notice the dangling 's' at the last line

Change History (1)

A proposed patch which creates a lock file

Note: See TracTickets for help on using tickets.