Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Dec 2009 09:51:26 -0600 (CST)
From:      "Sean C. Farley" <scf@FreeBSD.org>
To:        Brian Feldman <green@FreeBSD.org>
Cc:        svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
Subject:   Re: svn commit: r199983 - in head: lib/libc/stdlib tools/regression/environ
Message-ID:  <alpine.BSF.2.00.0912010942430.68765@thor.farley.org>
In-Reply-To: <200912010504.nB154VnS053167@svn.freebsd.org>
References:  <200912010504.nB154VnS053167@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 1 Dec 2009, Brian Feldman wrote:

> Author: green
> Date: Tue Dec  1 05:04:31 2009
> New Revision: 199983
> URL: http://svn.freebsd.org/changeset/base/199983
>
> Log:
>  Do not gratuitously fail *env(3) operations due to corrupt ('='-less)
>  **environ entries.  This puts non-getenv(3) operations in line with
>  getenv(3) in that bad environ entries do not cause all operations to
>  fail.  There is still some inconsistency in that getenv(3) in the
>  absence of any environment-modifying operation does not emit corrupt
>  environ entry warnings.
>
>  I also fixed another inconsistency in getenv(3) where updating the
>  global environ pointer would not be reflected in the return values.
>  It would have taken an intermediary setenv(3)/putenv(3)/unsetenv(3)
>  in order to see the change.

A simpler patch[1] is to have the build and merge routines skip unusable 
environ entries and continue to the next entry.  It still can return an 
error due to memory allocation problems, but those do not necessarily 
reflect a corrupt environ array.

I want to test a few more things first.

Sean
   1. http://people.freebsd.org/~scf/getenv-1.patch
-- 
scf@FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.0912010942430.68765>