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
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: sk8boardkid at gmail dot com
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Fri Apr 19 09:01:27 2024 UTC