From owner-svn-src-all@FreeBSD.ORG Sun Apr 19 13:51:26 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26121B2B; Sun, 19 Apr 2015 13:51:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13FC2D76; Sun, 19 Apr 2015 13:51:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3JDpPll000558; Sun, 19 Apr 2015 13:51:25 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3JDpP0o000557; Sun, 19 Apr 2015 13:51:25 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201504191351.t3JDpP0o000557@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 19 Apr 2015 13:51:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281743 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Apr 2015 13:51:26 -0000 Author: jilles Date: Sun Apr 19 13:51:25 2015 New Revision: 281743 URL: https://svnweb.freebsd.org/changeset/base/281743 Log: MFC r280919: wordexp: Explicitly pass along IFS. Per Austin group issue #884, sh should not import IFS from the environment but always set it to $' \t\n'. For wordexp(), however, it is documented and useful for it to use IFS from the environment. Since sh currently imports IFS from the environment, this change has no functional effect. Modified: stable/10/lib/libc/gen/wordexp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/wordexp.c ============================================================================== --- stable/10/lib/libc/gen/wordexp.c Sun Apr 19 13:46:13 2015 (r281742) +++ stable/10/lib/libc/gen/wordexp.c Sun Apr 19 13:51:25 2015 (r281743) @@ -118,8 +118,10 @@ we_askshell(const char *words, wordexp_t char *nstrings; /* Temporary for realloc() */ char **nwv; /* Temporary for realloc() */ sigset_t newsigblock, oldsigblock; + const char *ifs; serrno = errno; + ifs = getenv("IFS"); if (pipe2(pdes, O_CLOEXEC) < 0) return (WRDE_NOSPACE); /* XXX */ @@ -145,7 +147,8 @@ we_askshell(const char *words, wordexp_t _fcntl(pdes[1], F_SETFD, 0)) < 0) _exit(1); execl(_PATH_BSHELL, "sh", flags & WRDE_UNDEF ? "-u" : "+u", - "-c", "eval \"$1\";eval \"wordexp $2\"", "", + "-c", "IFS=$1;eval \"$2\";eval \"wordexp $3\"", "", + ifs != NULL ? ifs : " \t\n", flags & WRDE_SHOWERR ? "" : "exec 2>/dev/null", words, (char *)NULL); _exit(1);