Cygwin: add secure_getenv
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
This commit is contained in:
@@ -549,6 +549,16 @@ _getenv_r (struct _reent *, const char *name)
|
||||
return findenv_func (name, &offset);
|
||||
}
|
||||
|
||||
/* Like getenv, but returns NULL if effective and real UID/GIDs do not match */
|
||||
extern "C" char *
|
||||
secure_getenv (const char *name)
|
||||
{
|
||||
int offset;
|
||||
if (cygheap->user.issetuid ())
|
||||
return NULL;
|
||||
return findenv_func (name, &offset);
|
||||
}
|
||||
|
||||
/* Return number of environment entries, including terminating NULL. */
|
||||
static int __stdcall
|
||||
envsize (const char * const *in_envp)
|
||||
|
Reference in New Issue
Block a user