Re: Environment handling broken in /bin/sh with changes to {get,set,put}env()

From: Andrey Chernov <ache_at_nagual.pp.ru>
Date: Wed, 4 Jul 2007 18:36:42 +0400
On Wed, Jul 04, 2007 at 03:53:41PM +0200, Michal Mertl wrote:
> I have tracked it down to the changes in {get,set,put}env and
> src/bin/sh/var.c 1.36. I have checked (by inserting printf just before
> the call) that the arguments passed to putenv() in var.c are reasonable,
> yet the above mentioned warning is issued.

1) I don't check it yet, but there is no putenv() calls in var.c 1.36 in 
anycase.

2) "s" may point to getenv()-provided value there. So just modifying it 
directly followed by setenv() call will make things inconsistent.

3) In my version of patch there was savestr() which copy arg to avoid this 
situation.

Fix will be to restore var.c to mine variant 1.34

-- 
http://ache.pp.ru/
Received on Wed Jul 04 2007 - 12:36:45 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:13 UTC