From owner-freebsd-current@FreeBSD.ORG Fri Jul 13 22:40:56 2007 Return-Path: X-Original-To: freebsd-current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6DB1516A409; Fri, 13 Jul 2007 22:40:56 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id D437A13C4B4; Fri, 13 Jul 2007 22:40:55 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.1/8.14.1) with ESMTP id l6DMesK1021849; Sat, 14 Jul 2007 02:40:54 +0400 (MSD) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nagual.pp.ru; s=default; t=1184366454; bh=lFTc1ju+KhrORT0bPjN5kehAEP7bS5lxYck4UtX mccc=; l=776; h=Received:Date:From:To:Cc:Subject:Message-ID: Mail-Followup-To:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:User-Agent; b=KLAznw9OOgJtULdZsUWn TtQ+7pb7mFkp87DGfmnCsJoTeJMfoayEn37hgX4wALc/pT2A5xIFIwC+c94sykEQQBl lc8CMsjAELpJ5V8/o4KSiU+EuyAYHa0gqBLi56vdH3Gbl+qtGbkYA9gc+ud/zobQ1Y4 ntr2IjbLwZI9yjTQw= Received: (from ache@localhost) by nagual.pp.ru (8.14.1/8.14.1/Submit) id l6DMesHZ021848; Sat, 14 Jul 2007 02:40:54 +0400 (MSD) (envelope-from ache) Date: Sat, 14 Jul 2007 02:40:53 +0400 From: Andrey Chernov To: "Sean C. Farley" Message-ID: <20070713224053.GA21695@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , "Sean C. Farley" , freebsd-current References: <20070707131359.GB96605@nagual.pp.ru> <20070707133102.C14065@thor.farley.org> <20070707191835.GA4368@nagual.pp.ru> <20070707205410.B14065@thor.farley.org> <20070708020940.GA80166@nagual.pp.ru> <20070708171727.GA90490@nagual.pp.ru> <20070713162742.GA16260@nagual.pp.ru> <20070713142545.K26096@thor.farley.org> <20070713202433.GA19856@nagual.pp.ru> <20070713152644.I26096@thor.farley.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070713152644.I26096@thor.farley.org> User-Agent: Mutt/1.5.16 (2007-06-09) Cc: freebsd-current Subject: Re: Environment handling broken in /bin/sh with changes to t,set,put}env() X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2007 22:40:56 -0000 On Fri, Jul 13, 2007 at 05:15:37PM -0500, Sean C. Farley wrote: > Well technically, for setenv() and unsetenv() (the Open Group): > > If the application modifies environ or the pointers to which it > points, the behavior of unsetenv() is undefined. > > However, I would like to have *env() functions work in this case. It seems that anybody will agree with that. > I chose #3. Try the patch[1] again. It creates a setenv() function > which is a wrapper around __setenv(). __setenv() takes the lengths of > name and value to allow the caller to calculate the length using pointer > arithmetic instead of strlen(). > > Sean > 1. http://www.farley.org/freebsd/tmp/setenv/clearenv/patch The wrapper version finally looks OK for me. -- http://ache.pp.ru/