[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: env
From: |
Philip Rowlands |
Subject: |
Re: env |
Date: |
Tue, 20 Feb 2007 13:58:39 +0000 (GMT) |
On Mon, 19 Feb 2007, Harvey Eneman wrote:
I've experienced an issue with the env implementation due to its modification
of the environ external variable:
/* If no program is specified, print the environment and exit. */
if (argc <= optind)
{
while (*environ)
puts (*environ++);
exit (EXIT_SUCCESS);
}
The "extern" declaration of environ doesn't have the effect you imagine;
each process can modify only its own environment (and by extension the
environment specified in execve(2) passed to children which it forks).
As env exits immediately, I'm having difficulty seeing what problems
you're encountering.
The difficulty occurs when a LD_PRELOAD shared object uses glib
functions that rely in the stability of environ.
No function is called before exit(EXIT_SUCCESS).
Cheers,
Phil
- env, Harvey Eneman, 2007/02/20
- Re: env,
Philip Rowlands <=
- Re: env, Jim Meyering, 2007/02/20