From owner-svn-src-head@freebsd.org Sun Jun 4 20:52:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42F6DBEEA96; Sun, 4 Jun 2017 20:52:57 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 1158C83EE4; Sun, 4 Jun 2017 20:52:56 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v54KqumX009355; Sun, 4 Jun 2017 20:52:56 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v54KquQ1009352; Sun, 4 Jun 2017 20:52:56 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201706042052.v54KquQ1009352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 4 Jun 2017 20:52:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319575 - in head/bin/sh: . tests/errors X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Sun, 04 Jun 2017 20:52:57 -0000 Author: jilles Date: Sun Jun 4 20:52:55 2017 New Revision: 319575 URL: https://svnweb.freebsd.org/changeset/base/319575 Log: sh: Fix INTOFF leak when a redirection on a compound command fails. Reported by: bdrewery Added: head/bin/sh/tests/errors/redirection-error8.0 (contents, props changed) Modified: head/bin/sh/eval.c head/bin/sh/tests/errors/Makefile Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun Jun 4 19:58:14 2017 (r319574) +++ head/bin/sh/eval.c Sun Jun 4 20:52:55 2017 (r319575) @@ -470,6 +470,7 @@ evalredir(union node *n, int flags) if (e == EXERROR || e == EXEXEC) { if (in_redirect) { exitstatus = 2; + FORCEINTON; return; } } Modified: head/bin/sh/tests/errors/Makefile ============================================================================== --- head/bin/sh/tests/errors/Makefile Sun Jun 4 19:58:14 2017 (r319574) +++ head/bin/sh/tests/errors/Makefile Sun Jun 4 20:52:55 2017 (r319575) @@ -29,6 +29,7 @@ ${PACKAGE}FILES+= redirection-error4.0 ${PACKAGE}FILES+= redirection-error5.0 ${PACKAGE}FILES+= redirection-error6.0 ${PACKAGE}FILES+= redirection-error7.0 +${PACKAGE}FILES+= redirection-error8.0 ${PACKAGE}FILES+= write-error1.0 .include Added: head/bin/sh/tests/errors/redirection-error8.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/errors/redirection-error8.0 Sun Jun 4 20:52:55 2017 (r319575) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +$SH -c '{ { :; } /dev/null || kill -INT $$; echo continued' +r=$? +[ "$r" -gt 128 ] && [ "$(kill -l "$r")" = INT ]