From b2987142fa04864685b16e557538de52f2a62477d6ec0773ee2776d431707496 Mon Sep 17 00:00:00 2001 From: Avindra Goolcharan Date: Thu, 19 Nov 2020 23:16:20 +0000 Subject: [PATCH] Accepting request 849512 from home:dirkmueller:branches:shells - add check-nflag-in-evaltree.patch (bsc#1178978) - update to 0.5.11.2 (bsc#1177691): - add LICENSE file OBS-URL: https://build.opensuse.org/request/show/849512 OBS-URL: https://build.opensuse.org/package/show/shells/dash?expand=0&rev=32 --- check-nflag-in-evaltree.patch | 46 +++++++++++++++++++++++++++++++++++ dash.changes | 8 +++++- dash.spec | 4 +++ 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 check-nflag-in-evaltree.patch diff --git a/check-nflag-in-evaltree.patch b/check-nflag-in-evaltree.patch new file mode 100644 index 0000000..e6f83a0 --- /dev/null +++ b/check-nflag-in-evaltree.patch @@ -0,0 +1,46 @@ +From 29d6f2148f10213de4e904d515e792d2cf8c968e Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Thu, 4 Jun 2020 21:53:55 +1000 +Subject: eval: Check nflag in evaltree instead of cmdloop + +This patch moves the nflag check from cmdloop into evaltree. This +is so that nflag will be in force even if we enter the shell via a +path other than cmdloop, e.g., through sh -c. + +Reported-by: Joey Hess +Signed-off-by: Herbert Xu +--- + src/eval.c | 3 +++ + src/main.c | 2 +- + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/eval.c b/src/eval.c +index d10be38..9476fbb 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -213,6 +213,9 @@ evaltree(union node *n, int flags) + + setstackmark(&smark); + ++ if (nflag) ++ goto out; ++ + if (n == NULL) { + TRACE(("evaltree(NULL) called\n")); + goto out; +diff --git a/src/main.c b/src/main.c +index 7a28534..5c49fdc 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -233,7 +233,7 @@ cmdloop(int top) + out2str("\nUse \"exit\" to leave shell.\n"); + } + numeof++; +- } else if (nflag == 0) { ++ } else { + int i; + + job_warning = (job_warning == 2) ? 1 : 0; +-- +cgit 1.2.3-1.el7 + diff --git a/dash.changes b/dash.changes index bc08e70..c3cc8e4 100644 --- a/dash.changes +++ b/dash.changes @@ -1,8 +1,14 @@ +------------------------------------------------------------------- +Thu Nov 19 22:34:02 UTC 2020 - Dirk Mueller + +- add check-nflag-in-evaltree.patch (bsc#1178978) + ------------------------------------------------------------------- Sun Oct 18 18:08:34 UTC 2020 - Dirk Mueller -- update to 0.5.11.2: +- update to 0.5.11.2 (bsc#1177691): * shell: Group readdir64/dirent64 with open64 +- add LICENSE file ------------------------------------------------------------------- Sun Aug 16 17:55:38 UTC 2020 - Dirk Mueller diff --git a/dash.spec b/dash.spec index c7ba628..34de77c 100644 --- a/dash.spec +++ b/dash.spec @@ -25,6 +25,8 @@ License: BSD-3-Clause Group: System/Shells URL: http://gondor.apana.org.au/~herbert/dash/ Source: http://gondor.apana.org.au/~herbert/dash/files/dash-%{version}.tar.gz +# PATCH-FIX-UPSTREAM: https://git.kernel.org/pub/scm/utils/dash/dash.git/commit/?id=29d6f2148f10213de4e904d515e792d2cf8c968e +Patch1: check-nflag-in-evaltree.patch BuildRequires: libedit-devel %description @@ -33,6 +35,7 @@ possible without sacrificing speed where possible. %prep %setup -q +%autopatch -p1 %build %global optflags %{optflags} -fcommon @@ -49,6 +52,7 @@ mkdir -p %{buildroot}/bin ln -s %{_bindir}/dash %{buildroot}/bin/dash %files +%license COPYING %doc ChangeLog %{_bindir}/dash /bin/dash