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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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: Sat Dec 21 12:01:31 2024 UTC