php.net |  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: marshall at exclupen dot com
New email:
PHP Version: OS:

 

 [2003-08-29 20:57 UTC] marshall at exclupen dot com
Description:
------------
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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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