[wp-trac] [WordPress Trac] #15134: WordPress should not try to remove theme's or plugin's directory recursively if the directory is a symlink

WordPress Trac wp-trac at lists.automattic.com
Sat Oct 16 11:46:30 UTC 2010


#15134: WordPress should not try to remove theme's or plugin's directory
recursively if the directory is a symlink
---------------------------------+------------------------------------------
 Reporter:  vladimir_kolesnikov  |       Owner:                 
     Type:  defect (bug)         |      Status:  new            
 Priority:  normal               |   Milestone:  Awaiting Review
Component:  Upgrade/Install      |     Version:                 
 Severity:  normal               |    Keywords:                 
---------------------------------+------------------------------------------
 Consider the situation: there is a server with multiple WordPress blogs
 hosted in it. Some plugins are common for all/many blogs and to save
 several (hundreds in our case) megs of the disk space, shared plugins are
 stored somehwere else (say, /var/www/wp-plugins) and there are symbolic
 links to /var/www/wp-plugins/<plugins> from /home/<user>/wp-
 content/plugins/<plugins>.

 The onwer of the blog (user1) may not know these details and wants to
 update one of the plugins (plugin1) using automatic update feature.
 WordPress will then try to remove /home/user1/wp-content/plugins/plugin1/
 recursively although /home/user1/wp-content/plugins/plugin1 is a symlink
 to /var/www/wp-plugins/plugin1.

 The obvious solution is to add a check to the filesystem classes that
 checks if the file is a symlink and if so, remove symlink with unlink()
 instead of trying to follow it and remove everything it sees.

 The advantage of this approach is that if the user symlinks a plugin to
 other user's data, those data will not be removed by WordPress (this can
 be very good for those hosts where all users are served by the same Apache
 user etc).

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15134>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list