From owner-cvs-all@FreeBSD.ORG Mon Apr 30 17:37:53 2007 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6400616A402; Mon, 30 Apr 2007 17:37:53 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.freebsd.org (Postfix) with ESMTP id 09C0113C457; Mon, 30 Apr 2007 17:37:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id l3UHbobR015350; Mon, 30 Apr 2007 13:37:50 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Andrey Chernov Date: Mon, 30 Apr 2007 12:56:14 -0400 User-Agent: KMail/1.9.6 References: <200704301516.l3UFGJbu019162@repoman.freebsd.org> <200704301229.21190.jhb@freebsd.org> <20070430164031.GA82368@nagual.pp.ru> In-Reply-To: <20070430164031.GA82368@nagual.pp.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200704301256.15557.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 30 Apr 2007 13:37:50 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/3184/Mon Apr 30 09:51:57 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.3 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/usr.sbin/sysinstall main.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Apr 2007 17:37:53 -0000 On Monday 30 April 2007 12:40:31 pm Andrey Chernov wrote: > On Mon, Apr 30, 2007 at 12:29:20PM -0400, John Baldwin wrote: > > Have you coordinated at all with the guy on current@ who has patches to make > > setenv(3) not leak memory as bad? > > No, I don't touch current allocation scheme at all. It isn't my goal. > > > Also, given that we malloc a limited space > > for the string values, I don't see how you can make it so that one can always > > just overwrite the string pointed to by putenv(3)'s return value to change > > the value. If we malloc a buffer for length N and the user wants to set the > > length to M > N, we pretty much have to malloc a new buffer that will end up > > at a different address, so places holding onto the previous value returned > > from putenv(3) will stop seeing updates. > > It isn't the issue. Putenv value supposed to live just up to the next > putenv or setenv call, so setenv can legitimately overwrite it. Ok. FWIW, this seems like a ridiculous and gross hack just to provide a backdoor for updating the environment w/o making a fooenv() function call (either putenv, or setenv). -- John Baldwin