From owner-freebsd-current@FreeBSD.ORG Fri Jul 13 23:09:09 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 A6F7716A404; Fri, 13 Jul 2007 23:09:09 +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 20EB413C461; Fri, 13 Jul 2007 23:09:08 +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 l6DN97ER022295; Sat, 14 Jul 2007 03:09:07 +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=1184368148; bh=OyN4fzwbOL12crGGTxE9fAcsU9WocFvk7IrgsGG j+l0=; l=734; h=Received:Date:From:To:Subject:Message-ID: Mail-Followup-To:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:User-Agent; b=HF6Tsdq/D/n2noOx3DGk 2MMQXZB3Dsg7XSlFrd5FMijMABPyFY0PavILmXgJurHE8E74l4CNkk4KQZc7pjFAMOR VLtAe6Clw4bt23FX8q+N8cGx4FAsBnHXh2ft3HQ4K/p+WW3sVhyDNEPDiw8RPg0deF/ uGuPnLLSIyoIeXqf4= Received: (from ache@localhost) by nagual.pp.ru (8.14.1/8.14.1/Submit) id l6DN97XF022293; Sat, 14 Jul 2007 03:09:07 +0400 (MSD) (envelope-from ache) Date: Sat, 14 Jul 2007 03:09:06 +0400 From: Andrey Chernov To: "Sean C. Farley" , freebsd-current Message-ID: <20070713230906.GB22124@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , "Sean C. Farley" , freebsd-current References: <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> <20070713224053.GA21695@nagual.pp.ru> <20070713230241.GA22124@nagual.pp.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070713230241.GA22124@nagual.pp.ru> User-Agent: Mutt/1.5.16 (2007-06-09) Cc: 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 23:09:09 -0000 On Sat, Jul 14, 2007 at 03:02:41AM +0400, Andrey Chernov wrote: > > > Sean > > > 1. http://www.farley.org/freebsd/tmp/setenv/clearenv/patch > > > > The wrapper version finally looks OK for me. > > BTW, since strlen(value) is common part, you may decrease one argument to > __setenv() call just passing value and doing strlen(value) inside it like > before, i.e. > valueLen = strlen(value); One thing more - this is a user name space pollution because ends up into common block .global: +const char CorruptEnvFindMsg[] = "environment corrupt; unable to find %.*s"; +const char CorruptEnvValueMsg[] = "environment corrupt; missing value for %s"; Better replace with static const char ... -- http://ache.pp.ru/