public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix dl-environ.c
@ 2002-09-11 14:54 Jakub Jelinek
  2002-09-11 15:04 ` Roland McGrath
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2002-09-11 14:54 UTC (permalink / raw)
  To: Ulrich Drepper, Roland McGrath; +Cc: Glibc hackers

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-09-11 22:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-11 14:54 [PATCH] Fix dl-environ.c Jakub Jelinek
2002-09-11 15:04 ` Roland McGrath
2002-09-11 15:10   ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).