-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Mike Frysinger on 10/24/2009 12:11 AM:
> On Friday 23 October 2009 14:44:03 Eric Blake wrote:
>> Is 'env -i -u a=b' really supposed to output a=b, or should it be an error
>> (because a=b is not a valid environment name)? Right now, it is the
>> former, because we are using putenv() to remove variables from environ,
>> rather than unsetenv(). Similarly, should env -u '' issue an error?
>
> i dont think these things should error as there's no actual limitation in the
> coreutils code to do so (and POSIX allows this behavior). the code should
> call unsetenv() on whatever the user gives it. so in these two cases, it
> should do:
> unsetenv("a=b");
Which is required to fail. But right now we call putenv("a=b"), which
puts "a=b" into the environment instead of unsetting "a".
> unsetenv("");
Which is required to fail. But right now we call putenv(""), which is a
silent no-op.
>
> same goes for setting invalid env vars like:
> env foo.cow=moo some-cmd
> the env program should call:
> setenv("foo.cow", "moo", 1);
>
> the only error that should be emitted is if the underlying unsetenv() or
> setenv() functions fail
But that's my point - we aren't calling unsetenv(). Should we be?
- --
Don't work too hard, make some time for fun as well!
Eric Blake [email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkri8tEACgkQ84KuGfSFAYC/mACgjHEVsGr1LqNRKWX0JzPspOtR
Cb0AoKC5Y4/51KS9LoAbJ7e9Xs3FFXUa
=a/lR
-----END PGP SIGNATURE-----