svn commit: r199983 - in head: lib/libc/stdlib tools/regression/environ

Sean C. Farley scf at FreeBSD.org
Tue Dec 1 15:51:27 UTC 2009


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 at FreeBSD.org


More information about the svn-src-head mailing list