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>
|
2004-05-08 Pierre Humblet <pierre.humblet@ieee.org>
|
||||||
Christopher Faylor <cgf@timesys.com>
|
Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
|
@ -910,17 +910,18 @@ build_env (const char * const *envp, char *&envblock, int &envc,
|
|||||||
|
|
||||||
assert ((srcp - envp) == n);
|
assert ((srcp - envp) == n);
|
||||||
/* Fill in any required-but-missing environment variables. */
|
/* Fill in any required-but-missing environment variables. */
|
||||||
for (unsigned i = 0; i < SPENVS_SIZE; i++)
|
if (cygheap->user.issetuid ())
|
||||||
if (!saw_spenv[i])
|
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)
|
*dstp = spenvs[i].retrieve (no_envblock);
|
||||||
{
|
if (*dstp && !no_envblock && *dstp != env_dontadd)
|
||||||
tl += strlen (*dstp) + 1;
|
{
|
||||||
dstp++;
|
tl += strlen (*dstp) + 1;
|
||||||
}
|
dstp++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
envc = dstp - newenv; /* Number of entries in newenv */
|
envc = dstp - newenv; /* Number of entries in newenv */
|
||||||
assert ((size_t) envc <= (n + SPENVS_SIZE));
|
assert ((size_t) envc <= (n + SPENVS_SIZE));
|
||||||
*dstp = NULL; /* Terminate */
|
*dstp = NULL; /* Terminate */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user