Date: Sat, 3 Apr 2010 04:32:15 -0700 From: Garrett Cooper <yanefbsd@gmail.com> To: Joerg Sonnenberger <joerg@britannica.bec.de> Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r206043 - in head/usr.sbin/pkg_install: add delete lib version Message-ID: <t2n7d6fde3d1004030432mc5588c92ic8de3c260d0677@mail.gmail.com> In-Reply-To: <20100402001231.GA16732@britannica.bec.de> References: <201004011427.o31ERTaT056824@svn.freebsd.org> <k2m7d6fde3d1004011702ha697cd7bg96cf6bd8f58babb4@mail.gmail.com> <20100402001231.GA16732@britannica.bec.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Apr 1, 2010 at 5:12 PM, Joerg Sonnenberger <joerg@britannica.bec.de> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?t2n7d6fde3d1004030432mc5588c92ic8de3c260d0677>