I'm getting similar results from a RHEL 4 box we have here, its running
5.2.3-dev.
[EMAIL PROTECTED] [/tmp] # cat /etc/redhat-release
Red Hat Enterprise Linux ES release 4 (Nahant Update 4)
[EMAIL PROTECTED] [~] # uname -a
Linux scarlet 2.6.9-42.0.2.ELsmp #1 SMP Thu Aug 17 18:00:32 EDT 2006
i686 i686 i386 GNU/Linux
[EMAIL PROTECTED] [/tmp] # php test.php
dir
not a link
same
strace for the during execution is.
lstat64("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4096, ...}) = 0
lstat64("/tmp/link-test", {st_mode=S_IFLNK|0777, st_size=9, ...}) = 0
readlink("/tmp/link-test", "/tmp/pear", 4096) = 9
lstat64("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4096, ...}) = 0
lstat64("/tmp/pear", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/tmp/pear", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
write(1, "dir", 3dir) = 3
write(1, "\n", 1) = 1
write(1, "not a link", 10not a link) = 10
write(1, "\n", 1) = 1
time(NULL) = 1179958429
lstat64("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4096, ...}) = 0
lstat64("/tmp/pear", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64("/tmp/pear", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
write(1, "same", 4same) = 4
Scott
Arnold Daniels wrote:
Hi,
I've posted this problem some time ago, but never got a real answer and
it is still bothering me a lot.
My problem is that PHP does not recognize a symlink as a symlink. It
seems to be dereferenced by functions like 'lstat', 'is_link' and
'filetype'. And that isn't supposed to happen.
The bug http://bugs.php.net/bug.php?id=17128 describes my problem
exactly, but is marked as bogus. Well this problem sure isn't bogus for
me. I'm having this problem, since I've updated from Ubuntu Edgy to
Feisty. Before that all worked fine.
Please note that I've not installed PHP from a repository, but I build
the latest CVS version of PHP 5 regularly myself. Also this problem only
occurs in the Apache 2 SAPI, not in the CLI version.
Let me give an example, to make the problem clear.
------------
<?
$symlink = '/tmp/link-test';
$target = '/tmp/pear';
if (!file_exists($target)) trigger_error("Target '$target' does not
exist", E_USER_ERROR);
if (file_exists($symlink) && !unlink($symlink)) trigger_error("Could
not delete '$symlink'", E_USER_ERROR);
symlink($target, $symlink);
clearstatcache();
/* This should output 'link' */
echo filetype($symlink), "\n";
/* This should output 'link' */
echo is_link($symlink) ? 'link' : 'not a link', "\n";
/* This should output 'differ' */
echo lstat($symlink) === stat($target) ? 'same' : 'differ';
?>
Expected:
link
link
differ
Actual:
dir
not a link
same
------------
I understand that if I post this as a bug, it is tested, can't be
reproduced and marked as bogus. Therefore, I could appreciate it if
someone could please point me towards a way to pinpoint the problem.
I've run a strace already, but can't notice anything weird.
Thanks for any help,
Arnold
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php