Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-11511

phpbb_is_writable() fails on symlinks on Windows

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Won't Fix
    • 3.0.11
    • 3.0.15-RC1, 3.1.12-RC1
    • Other
    • None
    • Windows 7, PHP 5.3.21, PHP 5.4.12

    Description

      Path resolution for symlinks on Windows in phpbb_is_writable() ends up with a case difference on the drive letter which causes it to return false.

      The case difference is caused by realpath() returning a lowercase version while tempnam() returns one with an uppercase. This only happens with symlinks, using a normal directory results in both functions returning the path with an uppercase.

      In the example below, cache2 is symlinked to ./cache which is writable.

      tempnam('./cache2/', 'i_w'): c:\wamp\www\phpBB3\cache\i_wA8BE.tmp
      phpbb_realpath('./cache2/'): c:\wamp\www\phpBB3\cache
      realpath('./cache2/'): c:\wamp\www\phpBB3\cache
      tempnam(phpbb_realpath('./cache2/'), 'i_w'): C:\wamp\www\phpBB3\cache\i_wA8CE.tmp
      var_dump(phpbb_is_writable('./cache2/')): boolean false

      Non-symlinked:

      tempnam('./cache/', 'i_w'): C:\wamp\www\phpBB3\cache\i_w4557.tmp
      phpbb_realpath('./cache/'): C:\wamp\www\phpBB3\cache
      realpath('./cache/'): C:\wamp\www\phpBB3\cache
      tempnam(phpbb_realpath('./cache/'), 'i_w'): C:\wamp\www\phpBB3\cache\i_w4558.tmp
      var_dump(phpbb_is_writable('./cache/')): boolean true

      Attachments

        Activity

          People

            CHItA CHItA
            Noxwizard Patrick Webster
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: