Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 181469 - dev-lang/php5.2.2-r1 - is_link() returns bogus results
Summary: dev-lang/php5.2.2-r1 - is_link() returns bogus results
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: PHP Bugs
Depends on:
Reported: 2007-06-09 18:08 UTC by Pavel Stratil
Modified: 2008-04-22 10:59 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Stratil 2007-06-09 18:08:58 UTC
is_link() function in php returns bogus results.

Reproducible: Always

Steps to Reproduce:
1. create a symlink
2. php script: test if its a link by is_link(), compare it to readlink()

$ln = "/var/www/localhost/htdocs/notglued/__md5.js";
echo "testning: ".$ln;
clearstatcache(); echo "<br />is_link: ".is_link($ln);
clearstatcache(); echo "<br />vardump(is_link): ".var_dump(is_link($ln));
clearstatcache(); echo "<br />readlink: ".readlink($ln);


testning: /var/www/localhost/htdocs/notglued/__md5.js
is_link: bool(false)
readlink: /var/www/localhost/htdocs/notglued/md5.js

the file tested really is a symlink:

localhost ~ # ls -al /var/www/localhost/htdocs/notglued/*md5*
lrwxrwxrwx 1 kurapica kurapica   55 Jun  9 20:27 /var/www/localhost/htdocs/notglued/__md5.js -> /var/www/localhost/htdocs/notglued/md5.js
-rw-r--r-- 1 www      www      8827 Jun  4 18:33 /var/www/localhost/htdocs/notglued/md5.js

php is compiled as an apache2 module. php patched by the hardened-php patch. during testing i disabled the loaded extensions (suhosin, xcache, memcache).

this is the top of the phpinfo() result:

PHP Version 5.2.2-pl1-gentoo

System 	Linux localhost 2.6.20-gentoo #5 SMP PREEMPT Tue Feb 6 00:03:18 CET 2007 x86_64
Build Date 	Jun 5 2007 17:53:05
Configure Command 	'./configure' '--prefix=/usr/lib64/php5' '--host=x86_64-pc-linux-gnu' '--mandir=/usr/lib64/php5/man' '--infodir=/usr/lib64/php5/info' '--sysconfdir=/etc' '--cache-file=./config.cache' '--with-libdir=lib64' '--enable-maintainer-zts' '--disable-cli' '--with-apxs2=/usr/sbin/apxs2' '--with-config-file-path=/etc/php/apache2-php5' '--with-config-file-scan-dir=/etc/php/apache2-php5/ext-active' '--without-pear' '--enable-bcmath' '--with-bz2' '--enable-calendar' '--with-curl' '--with-curlwrappers' '--disable-dbase' '--enable-exif' '--without-fbsql' '--without-fdftk' '--disable-filter' '--enable-ftp' '--with-gettext' '--with-gmp' '--disable-json' '--with-kerberos=/usr' '--enable-mbstring' '--with-mcrypt' '--with-mhash' '--without-msql' '--without-mssql' '--with-ncurses' '--with-openssl' '--with-openssl-dir=/usr' '--enable-pcntl' '--disable-pdo' '--without-pgsql' '--disable-posix' '--with-pspell' '--without-recode' '--disable-simplexml' '--disable-shmop' '--without-snmp' '--disable-soap' '--enable-sockets' '--without-sybase' '--without-sybase-ct' '--disable-sysvmsg' '--disable-sysvsem' '--disable-sysvshm' '--with-tidy' '--disable-tokenizer' '--disable-wddx' '--disable-xmlreader' '--disable-xmlwriter' '--without-xmlrpc' '--with-xsl' '--enable-zip' '--with-zlib' '--disable-debug' '--enable-dba' '--without-cdb' '--with-db4' '--without-flatfile' '--without-gdbm' '--without-inifile' '--without-qdbm' '--with-freetype-dir=/usr' '--with-t1lib=/usr' '--enable-gd-jis-conv' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-gd' '--with-imap' '--with-imap-ssl' '--with-mysqli=/usr/bin/mysql_config' '--with-readline' '--without-libedit' '--without-mm' '--without-sqlite'
Actual Results:  
see steps to reproduce
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-08-10 16:17:02 UTC
Looks just fine w/ php-5.2.4_pre200708051230-r2

$ ln -s test.php testlink
$ php test.php 
 testing: /tmp/testlink
 vardump(is_link): bool(true)
 readlink: test.php
Comment 2 Pavel Stratil 2007-08-13 11:28:57 UTC
confirming: Looks just fine w/ php-5.2.4_pre200708051230-r2
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2007-08-13 11:41:20 UTC
Thanks for reporting back.