12345678910111213141516171819202122232425262728293031 |
- #ifndef _GNU_SOURCE
- # define _GNU_SOURCE
- #endif
- #include <stdlib.h>
- #include "internal/cryptlib.h"
- char *ossl_safe_getenv(const char *name)
- {
- #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
- # if __GLIBC_PREREQ(2, 17)
- # define SECURE_GETENV
- return secure_getenv(name);
- # endif
- #endif
- #ifndef SECURE_GETENV
- if (OPENSSL_issetugid())
- return NULL;
- return getenv(name);
- #endif
- }
|