|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25318 File::_getFilePointer() checks writable permissions on dir instead of file
Submitted: 2003-08-29 20:57 UTC Modified: 2004-09-01 16:21 UTC
From: marshall at exclupen dot com Assigned:
Status: Not a bug Package: PEAR related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: marshall at exclupen dot com
New email:
PHP Version: OS:


 [2003-08-29 20:57 UTC] marshall at exclupen dot com
From File::_getFilePointer():

// Writeable?
} elseif ( (FILE_MODE_WRITE == $mode OR FILE_MODE_APPEND == $mode)
    AND !file_exists($filename)
    AND !is_writeable(dirname($filename))) {

    return PEAR::raiseError('Could not create file: ' . $filename);

} elseif ( (FILE_MODE_WRITE == $mode OR FILE_MODE_APPEND == $mode)
    AND !is_writeable(dirname($filename))) {

    return PEAR::raiseError('File is not writeable: ' . $filename);

I believe that the second elseif should read:

    AND !is_writeable($filename)) {

The file can have writable permissions even though the directory it's in does not.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-01 16:21 UTC]
can you move this on - none of the pear maintainers read and it more likely the package maintainer will be able to help.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 01 20:01:29 2024 UTC