From:             [EMAIL PROTECTED]
Operating system: SuSe Linux 7.2
PHP version:      4.2.3
PHP Bug Type:     Filesystem function related
Bug description:  is_readable() & is_writable() failed on related paths

<?
function s($c) {
        echo "\$ $c\n";
        system($c);
        echo "\n";
}

function wr($f) {
        if(is_writable($f)) {
                echo "<b>$f</b> is writable.\n";
        } else {
                echo "<b>$f</b> is <font color='red'>NOT</font> writable.\n";
        }

        if(is_readable($f)) {
                echo "<b>$f</b> is readable.\n";
        } else {
                echo "<b>$f</b> is <font color='red'>NOT</font> readable.\n";
        }
}

$dir = "attachments";

s("whoami");
s("pwd");
s("ls -ld $dir");

wr($dir);

$dir2 = "$dir/test";
mkdir("$dir2");

wr($dir2);

//$dir3 = `pwd`;
$dir3 = $DOCUMENT_ROOT . "/phpbt/" . $dir;

wr($dir3);

?>

Output is:
------------------------------
$ whoami
nobody

$ pwd
/usr/local/httpd/web/phpbt

$ ls -ld attachments
drwxrwxrwx    4 nobody   nogroup      4096 Jan  9 18:50 attachments

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

Reply via email to