From owner-freebsd-current@FreeBSD.ORG Sat Jul 14 00:26:27 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 AFC7C16A400 for ; Sat, 14 Jul 2007 00:26:27 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from mail.farley.org (farley.org [67.64.95.201]) by mx1.freebsd.org (Postfix) with ESMTP id 7287C13C461 for ; Sat, 14 Jul 2007 00:26:27 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from thor.farley.org (thor.farley.org [192.168.1.5]) by mail.farley.org (8.14.1/8.14.1) with ESMTP id l6E0SH19057529; Fri, 13 Jul 2007 19:28:17 -0500 (CDT) (envelope-from scf@FreeBSD.org) Date: Fri, 13 Jul 2007 19:26:09 -0500 (CDT) From: "Sean C. Farley" To: Andrey Chernov In-Reply-To: <20070713230906.GB22124@nagual.pp.ru> Message-ID: <20070713192533.B26096@thor.farley.org> 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> <20070713230906.GB22124@nagual.pp.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.1 X-Spam-Checker-Version: SpamAssassin 3.2.1 (2007-05-02) on mail.farley.org 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: Sat, 14 Jul 2007 00:26:27 -0000 On Sat, 14 Jul 2007, Andrey Chernov wrote: > 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); Thank you. > 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 ... Oops. I thought I had made them static. Fixed. Sean -- scf@FreeBSD.org