[wp-trac] [WordPress Trac] #20365: [Patch] Fix getnumchmodfromh

WordPress Trac wp-trac at lists.automattic.com
Thu Sep 27 09:40:11 UTC 2012


#20365: [Patch] Fix getnumchmodfromh
------------------------------+------------------
 Reporter:  Keruspe           |       Owner:
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  3.5
Component:  Filesystem        |     Version:  2.6
 Severity:  minor             |  Resolution:
 Keywords:  has-patch commit  |
------------------------------+------------------
Changes (by dd32):

 * keywords:  has-patch => has-patch commit


Comment:

 I would personally like to remove this entirely from core.. we don't use
 it, and I can't find any plugins which do (although, obviously the OP here
 does). somewhat confusing is that  `getnumchmodfromh()`  returns a string
 representation of an octal number, which is not intuitive at all.

 It's also worth noting that `getnumchmodfromh()` does not work for values
 > 0777, which it was never designed for, but yet, `gethchmod` does
 support.

 The problem being triggered here, was that `getnumchmodfromh()` couldn't
 handle the executable bit (x) being set, all combinations of r&w worked
 fine, but introduce x and it would return incorrectly.

 Attached is a test script (run it from a web browser in wp-admin/) which
 can be used to verify the behaviour.

 Attached patch worksforme.

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


More information about the wp-trac mailing list