[PATCH] Fix dl-environ.c
Jakub Jelinek
jakub@redhat.com
Wed Sep 11 14:54:00 GMT 2002
Hi!
ld.so has apparently been too aggressive when removing variables
from environment, particularly it removed all the unsecure envvars (as
it should) plus all its prefixes, ie. it removed
LOCALDOMAIN, but e.g. LOCALDOMAI, LOCAL, LOCA, LO or L variables too.
2002-09-11 Jakub Jelinek <jakub@redhat.com>
* sysdeps/generic/dl-environ.c (unsetenv): Only remove variables fully
matching name.
--- libc/sysdeps/generic/dl-environ.c.jj 2002-03-23 11:51:04.000000000 +0100
+++ libc/sysdeps/generic/dl-environ.c 2002-09-11 22:53:42.000000000 +0200
@@ -67,7 +67,7 @@ unsetenv (const char *name)
while ((*ep)[cnt] == name[cnt] && name[cnt] != '\0')
++cnt;
- if ((*ep)[cnt] == '=')
+ if ((*ep)[cnt] == '=' && name[cnt] == '\0')
{
/* Found it. Remove this pointer by moving later ones to
the front. */
Jakub
More information about the Libc-hacker
mailing list