ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-Dev
php-Dev
#27609 [Opn]: is_writable returns true for file that can not be written to
by gobzo at netscape dot net other posts by this author
Mar 15 2004 8:53PM messages near this date
#27609 [Opn->Fbk]: is_writable returns true for file that can not be written to | #27608 [NEW]: mysql_free_result causes segfault with invalid result and exceptionerrorhandler
ID:               27609
 User updated by:  gobzo at netscape dot net
 Reported By:      gobzo at netscape dot net
 Status:           Open
 Bug Type:         *Directory/Filesystem functions
 Operating System: Windows XP Pro
 PHP Version:      4.3.5RC3
 New Comment:

Apology! I mixed up results. They should read:

Expected result:
----------------
Read only

Actual result:
--------------
Writable


Previous Comments:
------------------------------------------------------------------------

[2004-03-15 15:51:45] gobzo at netscape dot net

Description:
------------
I experience a situation, where Apache runs under the user name, who
does not have rights to write to a certain directory. This has been
tested and found working: I logged in under that user and received
Access denied error trying to save a changed file in this folder.
The problem is that if I call is_writable() against files in that
folder (and the folder itself!), it will return true which it utterly
wrong. Of course, subsequent writes to the files fail because the files
in fact can not be written to, but the scripts do not know about that.
My wild guess would be this is Windows or WinXP related issue, I do not
have a Linux box to check, but if needed, I can set it up - just email
me.

Reproduce code:
---------------
1. Create a folder 'foo' and file 'bar' in that folder.
2. Create a new user User1 and assign his rights to a folder 'foo' so
that his Allow/Write is unchecked.
3. Run Apache under this user.
4. Create ./foo.php with the following code:
<?php
  if (is_writable("bar"))
    echo "Writable";
  else
    echo "Read only";
?> 

5. Go with your browser to localhost/foo.php


Expected result:
----------------
Writable

Actual result:
--------------
Read only


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=27609&edit=1
Thread:
gobzo at netscape dot net
quentinjs at canada dot com

gobzo at netscape dot net


gobzo at netscape dot net

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved