]> granicus.if.org Git - sudo/commitdiff
Mark the putenv(), setenv() and unsetenv() symbols as global, not
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 29 Oct 2014 16:54:40 +0000 (10:54 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 29 Oct 2014 16:54:40 +0000 (10:54 -0600)
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().

src/env_hooks.c

index 3a41d173151a22f6c2be1b94a6b524ec8d72e9aa..fd1e378480fdd3298934963e9939768a5b3c6023 100644 (file)
@@ -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)
 {