mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 12:29:32 +08:00
2004-05-09 Pierre Humblet <pierre.humblet@ieee.org>
* environ.cc (build_env): Only try to construct required-but-missing variables while issetuid.
This commit is contained in:
parent
b5793c5c8c
commit
94f29ccdf6
@ -1,3 +1,8 @@
|
||||
2004-05-09 Pierre Humblet <pierre.humblet@ieee.org>
|
||||
|
||||
* environ.cc (build_env): Only try to construct required-but-missing
|
||||
variables while issetuid.
|
||||
|
||||
2004-05-08 Pierre Humblet <pierre.humblet@ieee.org>
|
||||
Christopher Faylor <cgf@timesys.com>
|
||||
|
||||
|
@ -910,16 +910,17 @@ build_env (const char * const *envp, char *&envblock, int &envc,
|
||||
|
||||
assert ((srcp - envp) == n);
|
||||
/* Fill in any required-but-missing environment variables. */
|
||||
for (unsigned i = 0; i < SPENVS_SIZE; i++)
|
||||
if (!saw_spenv[i])
|
||||
{
|
||||
*dstp = spenvs[i].retrieve (no_envblock);
|
||||
if (*dstp && !no_envblock && *dstp != env_dontadd)
|
||||
{
|
||||
tl += strlen (*dstp) + 1;
|
||||
dstp++;
|
||||
}
|
||||
}
|
||||
if (cygheap->user.issetuid ())
|
||||
for (unsigned i = 0; i < SPENVS_SIZE; i++)
|
||||
if (!saw_spenv[i])
|
||||
{
|
||||
*dstp = spenvs[i].retrieve (no_envblock);
|
||||
if (*dstp && !no_envblock && *dstp != env_dontadd)
|
||||
{
|
||||
tl += strlen (*dstp) + 1;
|
||||
dstp++;
|
||||
}
|
||||
}
|
||||
|
||||
envc = dstp - newenv; /* Number of entries in newenv */
|
||||
assert ((size_t) envc <= (n + SPENVS_SIZE));
|
||||
|
Loading…
x
Reference in New Issue
Block a user