[uClibc-cvs] CVS uClibc/ldso/ldso
CVS User jocke
jocke at codepoet.org
Wed Oct 6 11:34:33 UTC 2004
Update of /var/cvs/uClibc/ldso/ldso
In directory nail:/tmp/cvs-serv21800/ldso
Modified Files:
ldso.c
Log Message:
Peter S. Mazinger writes:
Hello!
Here is the modified unsecvars patch that applies to cvs.
--- /var/cvs/uClibc/ldso/ldso/ldso.c 2004/10/06 06:59:57 1.123
+++ /var/cvs/uClibc/ldso/ldso/ldso.c 2004/10/06 11:34:32 1.124
@@ -30,6 +30,7 @@
*/
#include "ldso.h"
+#include "unsecvars.h"
#define ALLOW_ZERO_PLTGOT
@@ -338,11 +339,21 @@
_dl_preload = _dl_getenv("LD_PRELOAD", envp);
_dl_library_path = _dl_getenv("LD_LIBRARY_PATH", envp);
} else {
+ static const char unsecure_envvars[] =
+#ifdef EXTRA_UNSECURE_ENVVARS
+ EXTRA_UNSECURE_ENVVARS
+#endif
+ UNSECURE_ENVVARS;
+ const char *nextp;
_dl_secure = 1;
- _dl_preload = _dl_getenv("LD_PRELOAD", envp);
- _dl_unsetenv("LD_AOUT_PRELOAD", envp);
- _dl_unsetenv("LD_LIBRARY_PATH", envp);
- _dl_unsetenv("LD_AOUT_LIBRARY_PATH", envp);
+
+ nextp = unsecure_envvars;
+ do {
+ _dl_unsetenv (nextp, envp);
+ /* We could use rawmemchr but this need not be fast. */
+ nextp = (char *) _dl_strchr(nextp, '\0') + 1;
+ } while (*nextp != '\0');
+ _dl_preload = NULL;
_dl_library_path = NULL;
}
More information about the uClibc-cvs
mailing list