From owner-svn-src-all@FreeBSD.ORG Sat Apr 3 11:32:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4ABA0106564A for ; Sat, 3 Apr 2010 11:32:20 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.221.181]) by mx1.freebsd.org (Postfix) with ESMTP id 026D58FC15 for ; Sat, 3 Apr 2010 11:32:15 +0000 (UTC) Received: by qyk11 with SMTP id 11so2752041qyk.13 for ; Sat, 03 Apr 2010 04:32:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=sP8d+0BugD50+36rNWUOBvJ3k6bnQMdDGo8GZZW0I80=; b=EuOHbA97D8EJquj5LHKNVU6jWsRzhQaTtnJMAf7zi5AmQIpHED63JUbykP/FFpH1v0 HIy4kjdkzwfodRzl2OK5o/4mjTRrh09vNeCL3cvZCQ1IqHrM/HdlgU4xm+P4E8qZCD1o V08qYULrwkTVHd8ulY2Gge5GoSJCddlQWbDYc= 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=dqBDJlXP+qDoFM1gsTNTOptEO7l39rjxHaCUbEQ6ndzBgfbRjLuoilUG9FxcoAc9Mg L4kpWfKzMCZCj7PNHnlr1j6U5PEU9N+7s5VAsVeMfdnBms41pPlQ9DMAjXUkAKI64Cbe sA1ekDXKJlyVA8ehmTOI9oOhz/SDB+FHtB6sg= MIME-Version: 1.0 Received: by 10.229.33.72 with HTTP; Sat, 3 Apr 2010 04:32:15 -0700 (PDT) In-Reply-To: <20100402001231.GA16732@britannica.bec.de> References: <201004011427.o31ERTaT056824@svn.freebsd.org> <20100402001231.GA16732@britannica.bec.de> Date: Sat, 3 Apr 2010 04:32:15 -0700 Received: by 10.229.234.68 with SMTP id kb4mr1209428qcb.103.1270294335250; Sat, 03 Apr 2010 04:32:15 -0700 (PDT) Message-ID: From: Garrett Cooper To: Joerg Sonnenberger Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r206043 - in head/usr.sbin/pkg_install: add delete lib version X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Apr 2010 11:32:20 -0000 On Thu, Apr 1, 2010 at 5:12 PM, Joerg Sonnenberger wrote: > On Thu, Apr 01, 2010 at 05:02:34PM -0700, Garrett Cooper wrote: >> =A0 =A0 1. FILENAME_MAX could be less than PATH_MAX, and actually is on >> the BSDs (256 vs 1024). PATH_MAX allows for duplicate slashes and all >> sorts of whacky path crud and probably should be used more liberally >> in the pkg_install code. This however isn't always true in the NetBSD >> case because they're aiming for portability of pkg_install, however >> PATH_MAX is always guaranteed to be at least as large as FILENAME_MAX. > > Well, I've been slowly working on eliminating the use of PATH_MAX in the > NetBSD/pkgsrc version of pkg_install. The performance gain from using > fixed stack space is minimal and the error handling generally > incompletely at best. > > Joerg Hi Joerg! I'm sorry but I'm a little bit confused by this statement: do you mean that you're replacing PATH_MAX sized buffers to FILENAME_MAX sized buffers? If so this may cause an issue because several of the variables used in constructing the file paths in pkg_install aren't necessarily correct in overflow cases. We need to avoid introducing potential functional flaws with filename truncation like this. I appreciate the work that you've done on the new version of pkg_install -- hopefully we can cross-pollinate some useful pieces with pkg_install in the near future. Thanks, -Garrett