php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38695 is_writable broken
Submitted: 2006-09-02 22:57 UTC Modified: 2006-09-12 01:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: sk8boardkid at gmail dot com Assigned:
Status: No Feedback Package: Filesystem function related
PHP Version: 4.4.4 OS: Linux
Private report: No CVE-ID: None
 [2006-09-02 22:57 UTC] sk8boardkid at gmail dot com
Description:
------------
The function "is_writable" does not work correctly:

The attached script does not give the correct result when run from the command line or from apache

the session.save_path is set to "/tmp" in php.ini which has the following permissions:

drwxrwxrwt   25 root     root         4096 Sep  2 23:30 tmp

this is the normal file permissions for the linux /tmp directory.

with these permissions any use can write into this directory, but the "is_writable" function returns "false"


Reproduce code:
---------------
<?php
   //checks if temp is writeable
   $sp=ini_get('session.save_path');
   echo $sp . "<br/>";
   if (is_writable($sp)) {      
      echo 'The file is writable';
   } else {
      echo 'The file is not writable';
   }
?>

Expected result:
----------------
/tmp<br/>The file is writable

Actual result:
--------------
/tmp<br/>The file is not writable

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-02 23:30 UTC] sk8boardkid at gmail dot com
a safe mode warning is not displayed when safe mode is turned on with uid checking.
 [2006-09-04 08:28 UTC] tony2001@php.net
var_dump($sp); ?
 [2006-09-12 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC