[wp-trac] [WordPress Trac] #25822: Upload folder permissions

WordPress Trac noreply at wordpress.org
Tue Nov 19 05:18:18 UTC 2013


#25822: Upload folder permissions
-----------------------------------------+--------------------
 Reporter:  petyo1313                    |       Owner:
     Type:  defect (bug)                 |      Status:  new
 Priority:  normal                       |   Milestone:  3.7.2
Component:  Media                        |     Version:  3.7
 Severity:  critical                     |  Resolution:
 Keywords:  reporter-feedback has-patch  |
-----------------------------------------+--------------------
Changes (by dd32):

 * keywords:  needs-patch reporter-feedback => reporter-feedback has-patch


Comment:

 The only thing I've been able to find is that `mkdir()`'s $mode is
 affected by `umask()`, but `chmod()` isn't, that would be a behaviour
 change between 3.6 and 3.7.

 umask basically sets the defaults for created files, by removing
 permissions from created files/directories.

 This means that we cannot use the `$recursive` option of `mkdir()` AND use
 the `$mode` parameter reliably without a work around.

 [attachment:25822.diff] attempts to work around this by in the event that
 it's detected that the umask altered the permissions it'd have created. In
 addition, `dirname()` doesn't return false, and also catches a case where
 `stat()` returns false resulting in the default value of `0777` not being
 used.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25822#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list