From: Todd C. Miller Date: Wed, 29 Oct 2014 16:54:40 +0000 (-0600) Subject: Mark the putenv(), setenv() and unsetenv() symbols as global, not X-Git-Tag: SUDO_1_8_12^2~99 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=55098ff6eccaa1cbb4d8bd788e40927657fbd509;p=sudo Mark the putenv(), setenv() and unsetenv() symbols as global, not hidden. Fixes a mismatch where a plugin (or its loaded dso) would call setenv() to set a variables but be unable to find it later with getenv(). --- diff --git a/src/env_hooks.c b/src/env_hooks.c index 3a41d1731..fd1e37848 100644 --- a/src/env_hooks.c +++ b/src/env_hooks.c @@ -76,9 +76,7 @@ getenv_unhooked(const char *name) return rpl_getenv(name); } -__dso_public char *getenv(const char *); - -char * +__dso_public char * getenv(const char *name) { char *val = NULL; @@ -148,7 +146,7 @@ putenv_unhooked(PUTENV_CONST char *string) return rpl_putenv(string); } -int +__dso_public int putenv(PUTENV_CONST char *string) { switch (process_hooks_putenv((char *)string)) { @@ -216,7 +214,7 @@ setenv_unhooked(const char *var, const char *val, int overwrite) return rpl_setenv(var, val, overwrite); } -int +__dso_public int setenv(const char *var, const char *val, int overwrite) { switch (process_hooks_setenv(var, val, overwrite)) { @@ -281,9 +279,9 @@ unsetenv_unhooked(const char *var) } #ifdef UNSETENV_VOID -void +__dso_public void #else -int +__dso_public int #endif unsetenv(const char *var) {