[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: lintian: shlib-read-write-env



Le 31/01/2017 à 16:56, Christian Seiler a écrit :
> (Any program that calls setenv() will call getenv() as well at
> some point, otherwise you could simply drop the setenv() completely;

Not necessarily. Instead of calling getenv, it can call fork+exec
(that will run an other program, MT or not, in the new environment).
The most classical example is the shell that can set lots of
environment variables from its startup files without necessarily
reading them.

> so any program that does that in an MT context is broken anyway,
> regardless of whether it uses a library that does an additional
> getenv().)

In an MT context, such a program should probably use setenv between
the fork and the exec (ie not in MT context) or, probably better,
use exec variants allowing to specify the new environment.

  Regards,
    Vincent

-- 
Vincent Danjean       GPG key ID 0xD17897FA         vdanjean@debian.org
GPG key fingerprint: 621E 3509 654D D77C 43F5  CA4A F6AE F2AF D178 97FA
Unofficial pkgs: http://moais.imag.fr/membres/vincent.danjean/deb.html
APT repo:  deb http://people.debian.org/~vdanjean/debian unstable main


Reply to: