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().
This commit is contained in:
Todd C. Miller
2014-10-29 10:54:40 -06:00
parent bbf3c08320
commit 55098ff6ec

View File

@@ -76,9 +76,7 @@ getenv_unhooked(const char *name)
return rpl_getenv(name); return rpl_getenv(name);
} }
__dso_public char *getenv(const char *); __dso_public char *
char *
getenv(const char *name) getenv(const char *name)
{ {
char *val = NULL; char *val = NULL;
@@ -148,7 +146,7 @@ putenv_unhooked(PUTENV_CONST char *string)
return rpl_putenv(string); return rpl_putenv(string);
} }
int __dso_public int
putenv(PUTENV_CONST char *string) putenv(PUTENV_CONST char *string)
{ {
switch (process_hooks_putenv((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); return rpl_setenv(var, val, overwrite);
} }
int __dso_public int
setenv(const char *var, const char *val, int overwrite) setenv(const char *var, const char *val, int overwrite)
{ {
switch (process_hooks_setenv(var, val, overwrite)) { switch (process_hooks_setenv(var, val, overwrite)) {
@@ -281,9 +279,9 @@ unsetenv_unhooked(const char *var)
} }
#ifdef UNSETENV_VOID #ifdef UNSETENV_VOID
void __dso_public void
#else #else
int __dso_public int
#endif #endif
unsetenv(const char *var) unsetenv(const char *var)
{ {