Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40415 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93677 invoked from network); 9 Sep 2008 15:59:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Sep 2008 15:59:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=arnaud.lb@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=arnaud.lb@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 72.14.220.157 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: arnaud.lb@gmail.com X-Host-Fingerprint: 72.14.220.157 fg-out-1718.google.com Received: from [72.14.220.157] ([72.14.220.157:22200] helo=fg-out-1718.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 59/35-23799-27D96C84 for ; Tue, 09 Sep 2008 11:59:47 -0400 Received: by fg-out-1718.google.com with SMTP id 16so1873758fgg.23 for ; Tue, 09 Sep 2008 08:59:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:cc:references:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:message-id; bh=I/mjfpWe4hSHxrwHH02QK9JzsZoOXNHX5YrOceo5a50=; b=HKT+stsPVIKoc4kq1qqu4HSmZljWLKnFEPfpJkD/AHu3K5vkmTPm04Ffps4hKl7C7f P7Vv92obc6jUFvc8J/pW/um7NiFEA8MX6efTRRUo3lFy7z9PdM26FcAsIAk8b4CPCBvp PkC8D0CpOM4jmwxtiWcnxs0qOxkLb4amBv7zA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:message-id; b=kFrSAEz511JqVDk+zdbhuA9+la6cmUlDpRPvH4sXkrfeBb8RUEwDDcJfmra1xpwPrA lgKRPksP1hBWMzxnbmxkuhYgFwmqC54ypTAMgmfne4sMjrGbS+7FbB/tAaXzV9BG40Ly mSnf83JUHJkhbFKuZC+txGQHPabKUF+5mr0P0= Received: by 10.180.211.5 with SMTP id j5mr12141255bkg.38.1220975984115; Tue, 09 Sep 2008 08:59:44 -0700 (PDT) Received: from 207-177-41-213.getmyip.com ( [213.41.177.207]) by mx.google.com with ESMTPS id z10sm4787989fka.15.2008.09.09.08.59.41 (version=SSLv3 cipher=RC4-MD5); Tue, 09 Sep 2008 08:59:42 -0700 (PDT) To: Christian Schneider Date: Tue, 9 Sep 2008 17:59:39 +0200 User-Agent: KMail/1.10.0 (Linux/2.6.26-1-amd64; KDE/4.1.0; x86_64; ; ) Cc: internals@lists.php.net, Alexey Zakhlestin References: <200809091651.55770.arnaud.lb@gmail.com> <48C697DA.2080003@cschneid.com> In-Reply-To: <48C697DA.2080003@cschneid.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200809091759.39808.arnaud.lb@gmail.com> Subject: Re: [PHP-DEV] Opinion needed (bug #45928) From: arnaud.lb@gmail.com (Arnaud Le Blanc) Hi, On Tuesday 09 September 2008 17:35:54 Christian Schneider wrote: > Arnaud Le Blanc wrote: > > The following may (no MacOS X to test) fix the problem by returning 0 from > > zend_stream_fsize() when the file descriptor is not a regular file: > > http://arnaud.lb.s3.amazonaws.com/45928.patch > > Your patch: > +#ifdef S_ISREG > + if (!S_ISREG(buf.st_mode)) { > + return 0; > + } > +#endif > might prevent mmap-ing symbolically linked files, I'll do a quick test > when I'm at home. No, fstat() will resolve the link and stat the file the link points to. And I believe script paths are fully resolved before being opened. Anyway, given the fstat() Linux man page, its a bug to return st_size when the file is not a regular file. > Not sure if we should also check for symbolic links (and what they point > to) or if that's overkill because the performance penalty is small > enough anyway. > > Anyone from the core developers got an opinion here? > > - Chris > Regards, Arnaud