On Sun, Oct 03, 2010 at 12:49:32AM +0200, Alan Barrett wrote:
> I suggest a BUGS section in putenv(3) stating that that the interface
> uses non-const char* for compatibility with POSIX brain damage, but the
> implementation guarantees to treat it as read-only.

There is not such guarantee really. Strings in the environment should
be writable. But in the past programs got away under NetBSD with
adding non-writable strings. If the program afterwards behaved
"nicely" e.g. by not writing to a pointer return by getenv(3)
there wasn't a problem.

All I wanted to do is restore that behaviour. I'm not sure whether
it is good idea to document that we tolerate it.

        Kind regards

-- 
Matthias Scheler                                  http://zhadum.org.uk/

Reply via email to