[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
env
From: |
Harvey Eneman |
Subject: |
env |
Date: |
Mon, 19 Feb 2007 15:06:58 -0800 |
User-agent: |
Thunderbird 1.5.0.9 (Windows/20061207) |
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 difficulty occurs when a LD_PRELOAD shared object uses glib
functions that rely in the stability of environ.
Is there a rational reason why a local variable is not being used? For
example:
/* If no program is specified, print the environment and exit. */
if (argc <= optind)
{
char **e = environ;
while (*e)
puts (*e++);
exit (EXIT_SUCCESS);
}
Thanks,
Harv
- env,
Harvey Eneman <=
- Re: env, Philip Rowlands, 2007/02/20
- Re: env, Jim Meyering, 2007/02/20