From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 383 invoked by alias); 11 Sep 2002 21:54:09 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 32688 invoked from network); 11 Sep 2002 21:54:08 -0000 Received: from unknown (HELO sunsite.mff.cuni.cz) (195.113.19.66) by sources.redhat.com with SMTP; 11 Sep 2002 21:54:08 -0000 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.11.6/8.11.6) id g8BLs2124465; Wed, 11 Sep 2002 23:54:02 +0200 Date: Wed, 11 Sep 2002 14:54:00 -0000 From: Jakub Jelinek To: Ulrich Drepper , Roland McGrath Cc: Glibc hackers Subject: [PATCH] Fix dl-environ.c Message-ID: <20020911235402.S1013@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-SW-Source: 2002-09/txt/msg00013.txt.bz2 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 * 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