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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Tue Oct 15 19:01:26 2024 UTC