From owner-freebsd-arch@FreeBSD.ORG Thu May 1 07:30:35 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 89EA537B404 for ; Thu, 1 May 2003 07:30:35 -0700 (PDT) Received: from gw.nectar.cc (gw.nectar.cc [208.42.49.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0945D43F85 for ; Thu, 1 May 2003 07:30:34 -0700 (PDT) (envelope-from nectar@celabo.org) Received: from madman.celabo.org (madman.celabo.org [10.0.1.111]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client CN "madman.celabo.org", Issuer "celabo.org CA" (verified OK)) by gw.nectar.cc (Postfix) with ESMTP id 791C8A3; Thu, 1 May 2003 09:30:33 -0500 (CDT) Received: by madman.celabo.org (Postfix, from userid 1001) id C8AC078C4A; Thu, 1 May 2003 09:30:32 -0500 (CDT) Date: Thu, 1 May 2003 09:30:32 -0500 From: "Jacques A. Vidrine" To: Paul Richards Message-ID: <20030501143032.GA34163@madman.celabo.org> Mail-Followup-To: "Jacques A. Vidrine" , Paul Richards , freebsd-arch@FreeBSD.org References: <20030430144149.GA7786@dragon.nuxi.com> <20030430002014.GA1190@dragon.nuxi.com> <20030430043303.GA46365@mero.morphisms.net> <20030430062647.GA82023@rot13.obsecurity.org> <20030430143121.GK39658@survey.codeburst.net> <20030430152708.GA26216@madman.celabo.org> <20030430153645.GL39658@survey.codeburst.net> <20030430164135.GB26508@madman.celabo.org> <20030501140255.GB1869@survey.codeburst.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030501140255.GB1869@survey.codeburst.net> X-Url: http://www.celabo.org/ User-Agent: Mutt/1.5.3i-ja.1 cc: freebsd-arch@FreeBSD.org Subject: Re: `Hiding' libc symbols (was Re: cvs commit: src/lib/libc/gen ...) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2003 14:30:35 -0000 On Thu, May 01, 2003 at 03:02:55PM +0100, Paul Richards wrote: > On Wed, Apr 30, 2003 at 11:41:35AM -0500, Jacques A. Vidrine wrote: > > [Trimmed cc:list; moving to freebsd-arch] > > > > > > First, has something been broken by making strlcpy/strlcat into a weak > > reference? > > Yes, deliberately overloading it from an application now no longer > works. Give me a break. Good, it should not work by accident. An application might define strlcpy for its own use, but we should NEVER use the application's strlcpy. [1] > What really concerns me though, is that behaviour is only defined > for 2 functions. No, it is done for some 150+ functions. If the technique didn't have a certain distasteful side-effect when used en masse, I would push for covering almost all of the other symbols libc exports. (If an application defines `strcpy', should we use that from within libc?) But until a better technique arrives, I am happy to apply it a little less liberally. There are some specialized instances where it _does_ make sense to override a function that libc utilizes. malloc and free are one example. The socket-related functions might be another (for SOCKS implementations). The fact that we've `hidden' connect(2) et al using this same technique for over two years without much impact on the functioning of such applications is a pretty good indicator to me that concerns in this area are unfounded. > I think this should be backed out, as most people in this thread > have pointed out, you've added a quirk to our C library to fix a > poorly coded application and whichever way you look at it, that's > not the right solution. > > The implementation of FreeBSD should be what's correct, we shouldn't > fudge things to accomodate bad packages, fix the problem where the > problem really exists. Obviously, I don't see it the same way you do. Calling the application's strlcpy in order to implement some internal libc function is not ``what's correct'', regardless of whether the application is buggy or perfect. Cheers, -- Jacques Vidrine . NTT/Verio SME . FreeBSD UNIX . Heimdal nectar@celabo.org . jvidrine@verio.net . nectar@freebsd.org . nectar@kth.se [1] I know. Never say never.