[459] in linux-security and linux-alert archive

home help back first fref pref prev next nref lref last post

Re: BoS: Telnetd Environment Vulnerability

daemon@ATHENA.MIT.EDU (Peter da Silva)
Mon Nov 6 16:53:48 1995

From: peter@nmti.com (Peter da Silva)
To: nobody@connect.com.au
Date: Mon, 6 Nov 1995 10:03:04 -0600 (CST)
Cc: linux-alert@tarsier.cv.nrao.edu
In-Reply-To: <199511030058.QAA24470@passer.osg.gov.bc.ca> from "Cy Schubert - BCSC Open Systems Group" at Nov 2, 95 04:58:43 pm
Reply-To: linux-security@tarsier.cv.nrao.edu

>         for (p1 = p2 = envp; *p1; p1++) {
>                 if (strncmp(*p1, "LD_", 3) != 0 &&
>                     strncmp(*p1, "_RLD", 4) != 0 &&
>                     strncmp(*p1, "LIBPATH=", 8) != 0 &&
>                     strncmp(*p1, "ELF_LD_", 7) != 0 &&
>                     strncmp(*p1, "AOUT_LD_", 8) != 0 &&
>                     strncmp(*p1, "IFS=", 4) != 0 ) {
>                             *p2++ = *p1;
>                 }
>         }

Wouldn't it be safer to do something like:

	if(strncmp(*p1, "TERM=", 5) == 0 ||
	   strncmp(*p1, "DISPLAY=", 8) == 0) *p2++ = *p1;

Is there any reason to copy the environment over to a possibly completely
different architecture? There's only a few variables that really need to be
transferred...

home help back first fref pref prev next nref lref last post