[wp-trac] [WordPress Trac] #40572: .htaccess has incorrect permissions after installation

WordPress Trac noreply at wordpress.org
Wed May 3 05:49:42 UTC 2017


#40572: .htaccess has incorrect permissions after installation
----------------------------------------+------------------------------
 Reporter:  i3anaan                     |       Owner:
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  Awaiting Review
Component:  Upgrade/Install             |     Version:  4.7.4
 Severity:  normal                      |  Resolution:
 Keywords:  needs-patch good-first-bug  |     Focuses:  administration
----------------------------------------+------------------------------
Changes (by dd32):

 * keywords:   => needs-patch good-first-bug
 * focuses:   => administration


Comment:

 Welcome to the WordPress Trac @i3anaan

 WordPress doesn't specify what permissions the `.htaccess` file should be
 created as, defaulting to whatever the server defaults to.
 A Server with a umask of `0066` seems unlikely, but appears to be the case
 here.

 It looks to me like we can probably always set the file permissions to a
 minimum of `0644` using something like the following in the creation
 branch of `insert_with_markers()`:
 {{{
 if ( $perms = fileperms( $filename ) ) {
         chmod( $filename, $perms | 0644 );
 }
 }}}

 In order to test implementation details of this, it might be helpful to
 whomever patches this to put `umask( 0066 )` into your `wp-config.php`file
 to simulate the reporters environment and test your patch's effectiveness.

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


More information about the wp-trac mailing list