Skip to content
Snippets Groups Projects
Commit b941095f authored by Craig Tiller's avatar Craig Tiller
Browse files

Comments

parent 9828aade
No related branches found
No related tags found
No related merge requests found
......@@ -49,11 +49,19 @@
#include "src/core/support/string.h"
/* Declare weak symbols for versions of secure_getenv that *may* be
* on a users machine. Older libc's call this __secure_getenv, even
* older don't support the functionality.
*
* If a symbol is not present, these will be equal to NULL.
*/
char *__attribute__((weak)) secure_getenv(const char *name);
char *__attribute__((weak)) __secure_getenv(const char *name);
char *gpr_getenv(const char *name) {
static char *(*getenv_func)(const char *) = secure_getenv;
/* Check to see which getenv variant is supported (go from most
* to least secure */
if (getenv_func == NULL) {
getenv_func = __secure_getenv;
if (getenv_func == NULL) {
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment