From:             dougcsd at yahoo dot com
Operating system: BlueWhite64
PHP version:      5.3.0alpha2
PHP Bug Type:     Filesystem function related
Bug description:  realpath on 64 bit system fails in safe mode on 
5.2.6-5.3.AlphaX

Description:
------------
This code segment runs in a file included from an upper level script.  The
same script appears to work correctly when PHP is compiled with the same
options on a 32 bit OS.

Apache 2.2 compiled from source

All php compiled from source

Linux kernel 2.6.26.2 compiled from source.  

libc:
-rwxr-xr-x 1 root root 1658189 2008-04-22 03:51 libc-2.7.so*
lrwxrwxrwx 1 root root      11 2008-06-17 18:22 libc.so.6 -> libc-2.7.so*

[EMAIL PROTECTED]:/lib# gcc --version
gcc (GCC) 4.2.3
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

./configure  --with-apxs2=/usr/local/apache2/bin/apxs
--with-mysql=/usr/local/my
sql --with-zlib --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr
--prefix=/usr
/local/php5 --enable-mbstring

Code:

$osd_root_path2 = realpath(dirname(__FILE__) . '/../../../') . '/';
$dump=fopen("/var/www/html/chat/dumptest","w");
  fprintf($dump,"%s\n%s\n",dirname(__FILE__),$osd_root_path2);
fclose($dump);

The file output was the same on 5.2.6 through 5.3.Alpha3

Output when safe mode is on:
/var/www/html/chat/inc/cmses
/

Output when safe mode is off:
/var/www/html/chat/inc/cmses
/var/www/html/


Reproduce code:
---------------
$osd_root_path2 = realpath(dirname(__FILE__) . '/../../../') . '/';
$dump=fopen("/var/www/html/chat/dumptest","w");
  fprintf($dump,"%s\n%s\n",dirname(__FILE__),$osd_root_path2);
fclose($dump);



Expected result:
----------------
Output when safe mode is off:
/var/www/html/chat/inc/cmses
/var/www/html/


Actual result:
--------------
Output when safe mode is on:
/var/www/html/chat/inc/cmses
/

-- 
Edit bug report at http://bugs.php.net/?id=46070&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=46070&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=46070&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=46070&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=46070&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=46070&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=46070&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=46070&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=46070&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=46070&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=46070&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=46070&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=46070&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=46070&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=46070&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=46070&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=46070&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=46070&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=46070&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=46070&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=46070&r=mysqlcfg

Reply via email to