cvs commit: src/lib/libc/stdlib getenv.3 getenv.c putenv.c setenv.c

Andrey Chernov ache at FreeBSD.org
Mon Apr 30 18:48:57 UTC 2007


On Mon, Apr 30, 2007 at 08:36:24PM +0200, Henrik Brix Andersen wrote:
> Todays changes to *env() appears to have broken stuff (my -CURRENT box
> fails to build many ports after these changes, due to missing
> environment variables in the build environment).
> 
> Here is a simple test-case:
> 
> $ env -vi foo=bar env
> #env clearing environ
> #env setenv:    foo=bar
> #env executing: env
> #env    arg[0]= 'env'
> 
> Notice that the second instance of env(1) doesn't see the $foo
> environment variable.
> 
> This is the output of the same test on my RELENG_6 box:
> 
> $ env -vi foo=bar env
> #env clearing environ
> #env setenv:    foo=bar
> #env executing: env
> #env    arg[0]= 'env'
> foo=bar

Thanx for the report, but please be patient a bit, work in the progress
and fix already planned soon.
To the matter: env incorrectly calls setenv("name=...", ...) which is
POSIX violation:

"The setenv( ) function shall fail if:
[EINVAL] The name argument is a null pointer, points to an empty string, 
or points to a string containing an '=' character."

-- 
http://ache.pp.ru/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20070430/370b5d55/attachment.pgp


More information about the cvs-src mailing list