Professional Web Applications Themes

#26051 [Opn->Bgs]: filetype() returns wrong type for device drivers - PHP Development

Removed by Administrator...

  1. Moderated Post

    Default #26051 [Opn->Bgs]: filetype() returns wrong type for device drivers

    Removed by Administrator
    sniper@php.net Guest
    Moderated Post

  2. Moderated Post

    Default #26051 [Opn->Bgs]: filetype() returns wrong type for device drivers

    Removed by Administrator
    sniper@php.net Guest
    Moderated Post

  3. #3

    Default #26051 [Opn->Bgs]: filetype() returns wrong type for device drivers

    ID: 26051
    Updated by: [email]sniperphp.net[/email]
    Reported By: six at t0x dot net
    -Status: Open
    +Status: Bogus
    Bug Type: Filesystem function related
    Operating System: win2k
    PHP Version: 4.3.4RC3
    New Comment:

    considered. Not PHP bug. Feel free to provide patch to 'fix' this
    though. But as long as Windows offers the stat() libc func, we use
    that. If it's not working as it should, it sure is not bug in PHP.




    Previous Comments:
    ------------------------------------------------------------------------

    [2003-10-31 10:06:30] six at t0x dot net

    Please consider the security problem stated above before definetly
    denying this is a bug

    ------------------------------------------------------------------------

    [2003-10-31 10:01:30] six at t0x dot net

    You seem to assume that the runtime c library is 100% compatible with
    the unix ones ...

    It's not that windows returns wrong types, just that windows provides
    *another way* to get the file type (the GetFileType API call).

    And no, filetype() doesn't work on windows ... At least as it's
    described in the doentation that says "Returns the type of the file"
    and not "Wrapper for the stat() libc call".

    This is an important problem, because it's currently impossible to
    protect an app from potential security issues regarding access to
    critical device files on win32 (like CON, PRN, CLOCK$, ...). A PHP app
    running on windows, receiving a file name from an untrusted input has
    *no way* to tell what the file really is.

    ------------------------------------------------------------------------

    [2003-10-31 09:39:31] [email]sniperphp.net[/email]

    filetype() does work just fine on windows.
    If windows returns 'wrong' types, it's not bug in PHP..


    ------------------------------------------------------------------------

    [2003-10-31 09:27:18] six at t0x dot net

    There are specific win32 API calls (GetFileType comes to my mind) to
    get this kind of information.

    I don't think this should be classified as "Bogus" because this is a
    very confusing behavior, at least, if you don't plan to fix the bug,
    the doentation should be updated to clearly state that filetype()
    does not work on Win32.

    ------------------------------------------------------------------------

    [2003-10-31 08:38:17] [email]sniperphp.net[/email]

    PHP returns whatever the libc stat() function returns for the filetype.
    No bug.


    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    [url]http://bugs.php.net/26051[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=26051&edit=1[/url]
    sniper@php.net Guest

Similar Threads

  1. #40164 [NEW]: filetype() generates wrong error message type
    By pcdinh at gmail dot com in forum PHP Bugs
    Replies: 1
    Last Post: January 19th, 10:04 AM
  2. #26051 [Bgs]: filetype() returns wrong type for device drivers
    By six at t0x dot net in forum PHP Development
    Replies: 0
    Last Post: October 31st, 03:02 PM
  3. #26051 [Bgs->Opn]: filetype() returns wrong type for device drivers
    By six at t0x dot net in forum PHP Development
    Replies: 0
    Last Post: October 31st, 02:28 PM
  4. #26051 [NEW]: filetype() returns wrong type for device drivers
    By six at t0x dot net in forum PHP Development
    Replies: 0
    Last Post: October 31st, 11:08 AM
  5. [PHP] Php returns wrong content-type (one php, two apaches)
    By Marek Kilimajer in forum PHP Development
    Replies: 0
    Last Post: September 24th, 12:32 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139