From owner-svn-src-head@FreeBSD.ORG Mon Dec 7 00:22:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 219D9106568B; Mon, 7 Dec 2009 00:22:11 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10FD28FC16; Mon, 7 Dec 2009 00:22:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB70MA6S036208; Mon, 7 Dec 2009 00:22:10 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB70MAHb036206; Mon, 7 Dec 2009 00:22:10 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <200912070022.nB70MAHb036206@svn.freebsd.org> From: Sean Farley Date: Mon, 7 Dec 2009 00:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200198 - head/lib/libc/stdlib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 00:22:11 -0000 Author: scf Date: Mon Dec 7 00:22:10 2009 New Revision: 200198 URL: http://svn.freebsd.org/changeset/base/200198 Log: Revert behavior change to setenv(), unsetenv() and putenv() until a more thorough security review has been completed. Modified: head/lib/libc/stdlib/getenv.c Modified: head/lib/libc/stdlib/getenv.c ============================================================================== --- head/lib/libc/stdlib/getenv.c Mon Dec 7 00:15:39 2009 (r200197) +++ head/lib/libc/stdlib/getenv.c Mon Dec 7 00:22:10 2009 (r200198) @@ -361,7 +361,8 @@ __build_env(void) } else { __env_warnx(CorruptEnvValueMsg, envVars[envNdx].name, strlen(envVars[envNdx].name)); - continue; + errno = EFAULT; + goto Failure; } /* @@ -376,7 +377,8 @@ __build_env(void) false) == NULL) { __env_warnx(CorruptEnvFindMsg, envVars[envNdx].name, nameLen); - continue; + errno = EFAULT; + goto Failure; } envVars[activeNdx].active = true; } @@ -558,7 +560,8 @@ __merge_environ(void) if ((equals = strchr(*env, '=')) == NULL) { __env_warnx(CorruptEnvValueMsg, *env, strlen(*env)); - continue; + errno = EFAULT; + return (-1); } if (__setenv(*env, equals - *env, equals + 1, 1) == -1)