Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50244 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48279 invoked from network); 16 Nov 2010 11:31:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Nov 2010 11:31:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.161.42 mail-fx0-f42.google.com Received: from [209.85.161.42] ([209.85.161.42:59957] helo=mail-fx0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C5/84-25603-7AB62EC4 for ; Tue, 16 Nov 2010 06:31:51 -0500 Received: by fxm13 with SMTP id 13so353933fxm.29 for ; Tue, 16 Nov 2010 03:31:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=iz8jSxBiHnBf/HAhiYofqvZDna1VF/WmmBmmhy5Otak=; b=UiPzeSiuUWMgTv1sQ/NrMbVWIehr9kvgbZ3HOh2G+R6GM+pwUHix7Dla7trm4DSTIf 24KNV60+wi8YSOeX4SO01lGGNlu0HvX10B+iX1grEqG2oXlnJTCjjzf1KxWY/iTH3lte lZNq6HeS0LF2EJWzgTDDxAoTMcr7u8VVPtsKQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=sDYoa6PJ4D4PK0PqnhY8IJPYKIgWUIuegu88ug034yQz9nZPJ332b6OOZjtlRznpJ1 cH+IbxeNh2FRN1QGgSs+xeltPuMUE9xBj2K7nqXCFvFblqohF4lOMcXyAYCGM59hqNyq n+M6iJUYYHYAAJTwOBxGfvkLXWnMuOhBe6t7o= MIME-Version: 1.0 Received: by 10.223.101.140 with SMTP id c12mr3967669fao.16.1289907108082; Tue, 16 Nov 2010 03:31:48 -0800 (PST) Received: by 10.223.96.7 with HTTP; Tue, 16 Nov 2010 03:31:48 -0800 (PST) In-Reply-To: <4CE2118A.7060601@sugarcrm.com> References: <4CE03E41.9030805@lerdorf.com> <8757232E56758B42B2EE4F9D2CA019C9086B69@US-EX2.zend.net> <4CE10E8E.3070901@lerdorf.com> <4CE206C0.5070701@sugarcrm.com> <4CE20C4E.3010709@lerdorf.com> <4CE2118A.7060601@sugarcrm.com> Date: Tue, 16 Nov 2010 12:31:48 +0100 Message-ID: To: Stas Malyshev Cc: Rasmus Lerdorf , internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Adding path_len to all stream functions in trunk From: pierre.php@gmail.com (Pierre Joye) On Tue, Nov 16, 2010 at 6:07 AM, Stas Malyshev wro= te: > Hi! > >> Yeah, I thought about that too. =A0Still not something we can do without >> breaking binary compatibility in the 5.3 branch though and I really >> would like to at least get all the core functions to guard themselves >> against null-poisoning there. > > How adding a new option char to zend_parse_parameters breaks BC? That's something I like to have as well. For two main reasons: - avoid painful and repetitive path cleaning (VCWD&co) - may save some memory ops (alloc, free, dup) while a file will not be processed many times by each part of the engine - exts do a check, then stream and TSRM at the end. That's expensive and should be removed A possible solution would be to return a struct with a smart str ptr for the given path, the resolved path and some custom OS specific data (like stats info, permissions, etc.). Doing so each information about a given path will be requested/generated only once. Cheers, --=20 Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org