From:             fulcrum at mbnet dot fi
Operating system: NetBSD
PHP version:      4CVS-2003-06-14 (stable)
PHP Bug Type:     Directory function related
Bug description:  getcwd() fails if parent directory miss readable-flag

Description:
------------
If one of the parent directories of the current working directory doesn't
have the readable flag +r (while +x is still specified) getcwd() return
false, even though the current directory has full (or at least readable &
executale) access (the restrictive permissions apply ONLY to the parent
directory).

The possible return value of false isn't either mentioned in the
documenation.

Reproduce code:
---------------
mkdir one ; mkdir one/two ; mkdir one/two/three
echo "<?php echo gettype(getcwd()).'; '; echo getcwd() ? 'true' : 'false';
?>" > one/sample.php
echo "<?php echo gettype(getcwd()).'; '; echo getcwd() ? 'true' : 'false';
?>" > one/two/sample.php
echo "<?php echo gettype(getcwd()).'; '; echo getcwd() ? 'true' : 'false';
?>" > one/two/three/sample.php
chmod 111 one ; chmod 755 one/two ; chmod 755 one/two/three
chmod 644 one/sample.php ; chmod 644 one/two/sample.php ; chmod 644
one/two/three/sample.php

Expected result:
----------------
one/sample.php:
string; true

one/two/sample.php:
string; true

one/two/three/sample.php:
string; true

Actual result:
--------------
one/sample.php:
string; true

one/two/sample.php:
boolean; false

one/two/three/sample.php:
boolean; false

-- 
Edit bug report at http://bugs.php.net/?id=24185&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=24185&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=24185&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=24185&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=24185&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=24185&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=24185&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=24185&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=24185&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=24185&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=24185&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24185&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=24185&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=24185&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=24185&r=gnused

Reply via email to