commit:     699457813484ed203c50f1bbc404b16676a57c81
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Sat Jan  9 14:50:36 2021 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Sat Jan  9 14:56:33 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69945781

app-shells/dash: Security revbump to fix -n calls

Bug: https://bugs.gentoo.org/754267
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 app-shells/dash/dash-0.5.11.3-r1.ebuild            | 61 ++++++++++++++++++++++
 .../dash-0.5.11.3-check_nflag_in_evaltree.patch    | 46 ++++++++++++++++
 2 files changed, 107 insertions(+)

diff --git a/app-shells/dash/dash-0.5.11.3-r1.ebuild 
b/app-shells/dash/dash-0.5.11.3-r1.ebuild
new file mode 100644
index 00000000000..1c194ba1661
--- /dev/null
+++ b/app-shells/dash/dash-0.5.11.3-r1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Debian Almquist Shell"
+HOMEPAGE="http://gondor.apana.org.au/~herbert/dash/";
+SRC_URI="http://gondor.apana.org.au/~herbert/dash/files/${P}.tar.gz";
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc 
~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris 
~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="libedit static"
+
+BDEPEND="virtual/pkgconfig"
+RDEPEND="!static? ( libedit? ( dev-libs/libedit ) )"
+DEPEND="${RDEPEND}
+       libedit? ( static? ( dev-libs/libedit[static-libs] ) )"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-0.5.11.3-check_nflag_in_evaltree.patch" #754267
+)
+
+src_prepare() {
+       default
+
+       # Fix the invalid sort
+       sed -i -e 's/LC_COLLATE=C/LC_ALL=C/g' src/mkbuiltins
+
+       # Use pkg-config for libedit linkage
+       sed -i \
+               -e "/LIBS/s:-ledit:\`$(tc-getPKG_CONFIG) --libs libedit $(usex 
static --static '')\`:" \
+               configure || die
+}
+
+src_configure() {
+       if [[ ${CHOST} == *-solaris* ]] ; then
+               # don't redefine stat, open, dirent, etc. on Solaris
+               export ac_cv_func_stat64=yes
+               export ac_cv_func_open64=yes
+
+               # if your headers strictly adhere to POSIX, you'll need this too
+               [[ ${CHOST##*solaris2.} -le 10 ]] && append-cppflags 
-DNAME_MAX=255
+       fi
+       if [[ ${CHOST} == powerpc-*-darwin* ]] ; then
+               sed -i -e 's/= stpncpy(s, \([^,]\+\), \([0-9]\+\))/+= 
snprintf(s, \2, "%s", \1)/' \
+                       src/jobs.c || die
+       fi
+       append-cppflags -DJOBS=$(usex libedit 1 0)
+       use static && append-ldflags -static
+       # Do not pass --enable-glob due to #443552.
+       local myeconfargs=(
+               CC_FOR_BUILD="$(tc-getBUILD_CC)"
+               --bindir="${EPREFIX}"/bin
+               --enable-fnmatch
+               $(use_with libedit)
+       )
+       econf "${myeconfargs[@]}"
+}

diff --git a/app-shells/dash/files/dash-0.5.11.3-check_nflag_in_evaltree.patch 
b/app-shells/dash/files/dash-0.5.11.3-check_nflag_in_evaltree.patch
new file mode 100644
index 00000000000..94740223fc8
--- /dev/null
+++ b/app-shells/dash/files/dash-0.5.11.3-check_nflag_in_evaltree.patch
@@ -0,0 +1,46 @@
+From 29d6f2148f10213de4e904d515e792d2cf8c968e Mon Sep 17 00:00:00 2001
+From: Herbert Xu <herb...@gondor.apana.org.au>
+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 <i...@joeyh.name>
+Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au>
+---
+ 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
+

Reply via email to