Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:29702 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66454 invoked by uid 1010); 23 May 2007 21:54:18 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 66430 invoked from network); 23 May 2007 21:54:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 May 2007 21:54:18 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 204.11.219.139 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 204.11.219.139 mail.lerdorf.com Received: from [204.11.219.139] ([204.11.219.139:59427] helo=mail.lerdorf.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C1/51-52937-508B4564 for ; Wed, 23 May 2007 17:54:16 -0400 Received: from trainburn-lm-corp-yahoo-com.local (c-24-6-22-164.hsd1.ca.comcast.net [24.6.22.164]) (authenticated bits=0) by mail.lerdorf.com (8.14.1/8.14.1/Debian-2) with ESMTP id l4NLs5OL002471 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 23 May 2007 14:54:05 -0700 Message-ID: <4654B7FA.2090806@lerdorf.com> Date: Wed, 23 May 2007 14:54:02 -0700 User-Agent: Thunderbird 2.0.0.0 (Macintosh/20070326) MIME-Version: 1.0 To: Arnold Daniels CC: internals@lists.php.net References: <4638E608.2090202@adaniels.nl> <4654A616.7050302@adaniels.nl> In-Reply-To: <4654A616.7050302@adaniels.nl> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.90.2/3288/Wed May 23 12:56:54 2007 on colo.lerdorf.com X-Virus-Status: Clean Subject: Re: [PHP-DEV] Still having lstat trouble From: rasmus@lerdorf.com (Rasmus Lerdorf) So, would this be Ubuntu 7.04? I happen to have one of those boxes sitting here: 5:52pm ubuntu:~> mkdir /tmp/pear 5:52pm ubuntu:~> cat /etc/issue Ubuntu 7.04 \n \l 5:52pm ubuntu:~> uname -a Linux ubuntu 2.6.20-15-server #2 SMP Sun Apr 15 07:41:34 UTC 2007 i686 GNU/Linux 5:52pm ubuntu:~> php p link link differ 5:52pm ubuntu:~> l /tmp | grep link lrwxrwxrwx 1 rasmus rasmus 9 2007-05-23 17:52 link-test -> /tmp/pear/ The 'p' script is just a copy of paste of your script from this message. -Rasmus 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 >