From owner-freebsd-current@FreeBSD.ORG Fri Jul 13 20:39:17 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 9E75716A402; Fri, 13 Jul 2007 20:39:17 +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 F39A713C471; Fri, 13 Jul 2007 20:39:16 +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 l6DKdFmV020317; Sat, 14 Jul 2007 00:39:15 +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=1184359155; bh=+sq9crwS3gV31ZzaSw8uiJXswahYgndUB6F7ucP wz5U=; l=1014; h=Received:Date:From:To:Subject:Message-ID: Mail-Followup-To:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:User-Agent; b=DgFxfu50gI4vZWi7sc6/ 2uMd7HpdvJY89y2G0I76qaRGzboektt9U2W6m+g/d0Lv3+el5QalLv+zMZRcC6jFY3j hFf6VfgyOz/SU4Dd8fJi8mzWIPbilvbuWOg8QzNakYuRdeUNqnATH12+wARjn+gJfSo fXwXcY3QWy+o4iNP8= Received: (from ache@localhost) by nagual.pp.ru (8.14.1/8.14.1/Submit) id l6DKdF3i020316; Sat, 14 Jul 2007 00:39:15 +0400 (MSD) (envelope-from ache) Date: Sat, 14 Jul 2007 00:39:15 +0400 From: Andrey Chernov To: "Sean C. Farley" , freebsd-current Message-ID: <20070713203915.GA20270@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , "Sean C. Farley" , freebsd-current References: <20070707130859.GA96605@nagual.pp.ru> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070713202433.GA19856@nagual.pp.ru> User-Agent: Mutt/1.5.16 (2007-06-09) Cc: Subject: Re: Environment handling broken in /bin/sh with changes to {get,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 20:39:17 -0000 On Sat, Jul 14, 2007 at 12:24:33AM +0400, Andrey Chernov wrote: > 1) I care in first hand about unsetenv() as my example states. There > nowhere said in the specs that unsetenv() may modify environ _content_, > manpage says about pointers only. Moreover, they directly states (at least for some cases) that environment should be left completely untouched, like that: "If the named variable does not exist in the current environment, the environment shall be unchanged and the function is considered to have completed successfully." > 2) That example not fail under FreeBSD 6 but fail under new code: > > nenv[0] = "PATH=/bin"; > nenv[1] = NULL; > environ = nenv; > setenv("HOME", "/xxx", 1); Similar thing to the setenv example: nenv[0] = "PATH=/bin"; setenv("PATH", "/bin", 0); "If the environment variable named by envname already exists and the value of overwrite is zero, the function shall return success and the environment shall remain unchanged." -- http://ache.pp.ru/