Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 May 2017 19:49:46 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r317912 - in head/bin/sh: . tests/builtins
Message-ID:  <201705071949.v47Jnk9r009300@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jilles
Date: Sun May  7 19:49:46 2017
New Revision: 317912
URL: https://svnweb.freebsd.org/changeset/base/317912

Log:
  sh: Fix INTOFF leak after a builtin with different locale settings.
  
  After executing a builtin with different locale settings such as
    LC_ALL=C true
  SIGINT handling was left disabled indefinitely.
  
  MFC after:	1 week

Added:
  head/bin/sh/tests/builtins/locale2.0   (contents, props changed)
Modified:
  head/bin/sh/tests/builtins/Makefile
  head/bin/sh/var.c

Modified: head/bin/sh/tests/builtins/Makefile
==============================================================================
--- head/bin/sh/tests/builtins/Makefile	Sun May  7 19:47:50 2017	(r317911)
+++ head/bin/sh/tests/builtins/Makefile	Sun May  7 19:49:46 2017	(r317912)
@@ -120,6 +120,7 @@ ${PACKAGE}FILES+=		local7.0
 .if ${MK_NLS} != "no"
 ${PACKAGE}FILES+=		locale1.0
 .endif
+${PACKAGE}FILES+=		locale2.0
 ${PACKAGE}FILES+=		printf1.0
 ${PACKAGE}FILES+=		printf2.0
 ${PACKAGE}FILES+=		printf3.0

Added: head/bin/sh/tests/builtins/locale2.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/bin/sh/tests/builtins/locale2.0	Sun May  7 19:49:46 2017	(r317912)
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+$SH -c 'LC_ALL=C true; kill -INT $$; echo continued'
+r=$?
+[ "$r" -gt 128 ] && [ "$(kill -l "$r")" = INT ]

Modified: head/bin/sh/var.c
==============================================================================
--- head/bin/sh/var.c	Sun May  7 19:47:50 2017	(r317911)
+++ head/bin/sh/var.c	Sun May  7 19:49:46 2017	(r317912)
@@ -513,7 +513,7 @@ bltinunsetlocale(void)
 		if (localevar(cmdenviron->args[i])) {
 			setlocale(LC_ALL, "");
 			updatecharset();
-			return;
+			break;
 		}
 	}
 	INTON;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705071949.v47Jnk9r009300>