summaryrefslogtreecommitdiff
path: root/app-shells/ksh
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-09-16 23:15:49 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-09-16 23:15:49 +0100
commit3b827127cdc24d49f3dbaa82def6c80501d2cd87 (patch)
tree4e3f67cb234339d4cb7c29ee99550a3362d5a1ca /app-shells/ksh
parent6e356edde093fb3589ab7a5859685e85c2873ab0 (diff)
gentoo auto-resync : 16:09:2022 - 23:15:49
Diffstat (limited to 'app-shells/ksh')
-rw-r--r--app-shells/ksh/Manifest9
-rw-r--r--app-shells/ksh/files/CVE-2019-14868.patch89
-rw-r--r--app-shells/ksh/files/ksh-2020.0.0-ensure-user-set.patch30
-rw-r--r--app-shells/ksh/files/ksh-2020.0.0-skip-api-test.patch36
-rw-r--r--app-shells/ksh/ksh-1.0.3.ebuild74
-rw-r--r--app-shells/ksh/ksh-2020.0.0-r1.ebuild50
-rw-r--r--app-shells/ksh/ksh-9999.ebuild6
7 files changed, 80 insertions, 214 deletions
diff --git a/app-shells/ksh/Manifest b/app-shells/ksh/Manifest
index 678e01c04881..e954901a4eec 100644
--- a/app-shells/ksh/Manifest
+++ b/app-shells/ksh/Manifest
@@ -1,10 +1,7 @@
-AUX CVE-2019-14868.patch 3746 BLAKE2B 0be6843120195f876631e92205430f8a389d23c6c9f85b72b4fd7b646551ede464eebaa28db1988a0b831642ab7d3c0e633cdfe28f5279ab29f69aa3bb6bb755 SHA512 ad21464b95ff69b0d8a54f54eee11d638738ba79a87fc5834d409af2d183e5a68e706b3f5df49223dd784e634de353335689981228c7ca57edf94794434d6ea9
AUX ksh-1.0.0-beta.2-gcc12.patch 4174 BLAKE2B 6ad9afdb51530d211dbf904cdc8c40ef740f4798f0c98aa39e5101c6093f5a61ed3de52344f73433142a721a5358b19137b48623a24e2ad25c3acbf3e6ebc180 SHA512 5f59cf7ff32c49f58e4b4842e78cb8ab3f29e24460f91ffb0c273ae3fb22d47897534bbe58b28b57b649dcf871f725cc2bf4d2ba3713973a9d8bbacab2f4e8d5
-AUX ksh-2020.0.0-ensure-user-set.patch 1017 BLAKE2B 8a0d9fd9fd8940969741214f6ba9251ae1b404bae80385d79428ab7231a5809bafcaa5033084af0582872171666e89b590b7c2cfba1ded740da49c77b1751888 SHA512 bea76ef4350d2813395bbfaa682b97a34548292efe9986a1d63dde2476bbfbfd21dc9b10ccb7ac3bcf33e9aeb3c0eebdcffb22a3b6472302597473ac994b2493
-AUX ksh-2020.0.0-skip-api-test.patch 1394 BLAKE2B bcf521012bb197d234b119dc56ddc068f8ec3e46b6f4c6d82e1043629368bfcabd1a5d360bae702777e5b01914ac70c9edbdce5ee0bba7e9f69916a3c38b1820 SHA512 e4314599821b3f654b4c87900aa696930953a96b984f43ca00fd17aa91b968ed8f277944c6736ebddae4ee7086e9806f84e3432b24450565d1c679bdbb39e01a
-DIST ksh-2020.0.0.tar.gz 2022880 BLAKE2B cb952c4febe88a3ccf8fd48f511a30a73bfc812ebf0b7a5fe799470b29ee13ca61004fd34e367d836940a88214da2aa05b7cb96f173a1b8d57c8e644c8c3a2a6 SHA512 7d6da3af341a62718d691ddc52e10bdf3b7290d74f1cd01610093c587af47b6d6d04b74b210eb31f93a3559855a5bc5155f9b188d2f8bb4444042c26bfaf1792
DIST ksh-v1.0.0-beta.2.tar.gz 2238224 BLAKE2B b4eb8e116d0dd8fda498fb8d2805613a73291be628ce87ebc1c47c9bc8c49b236b285accaf35b4c9e411df23b99c6a949b672edeea1f1f317fc85a2b4db48779 SHA512 c2cd5a4b442bcff1dd2c1c054ee79c4cb131dce28d811dcd3476164d6cb7e88e6b317a094b16f227564a1266708ef0cfeca2af0929c00a19497cf1b67c647cf2
+DIST ksh-v1.0.3.tar.gz 2110771 BLAKE2B 4316c78f7889fb2e4630a83dd0f1c5c4c4b418a822e8f7d3d9415a83bbef6e993cbd21b4842c7f56cd8647305c4bdddc04562b8788f2ee6e14698a9cb090f386 SHA512 9d6e664bc6c8d102ba09e692d057b9546b07ba3ecb060449df6648e7c99f8dfd670401e6fcf34f6f3de13338a3c31c09596344931ccfdf4cd4e49eabdf005c23
EBUILD ksh-1.0.0_beta2.ebuild 1548 BLAKE2B a0302d312d363f88e683fa77ca28c5a9798ca2b5827bbd8210a039f8b32d3f885cf3a5b5be7784b2eaef94656d607181d25bead15436f6a44b894005cc0a296b SHA512 1ca86eeb1dc7302d0636649a81448e02dc1840cd715cba70683954f58089571ad1fe4a2590f2037d71fd200cc886b589742d47df8a06579992877842bd392986
-EBUILD ksh-2020.0.0-r1.ebuild 1135 BLAKE2B 771f0f2bd6341ebeb69cfd5e3f1e478baf4c096e8e6898240af19a53881309f1ed12c5cd6fa3ff1faa33a3a128396d73258dc9541f99132b486c65c714a8168f SHA512 99a023e50d8156036258e971d8f62735ffe3b44b6ee3d967b5900070aacd75e8a3255cce84264e4e0ac8e9404959b5f246a0334f1d19abbf705303e0da88e57c
-EBUILD ksh-9999.ebuild 1539 BLAKE2B 909ef9118195ceaf4686823837b670401c6e0d641b2ecd44f9c251671265564528b043d695964df5c6dd2441cea5965c3f81e124132aee63959edab510f6c27d SHA512 8374cfb365fe819775d17576f77f8fdc95425becacfd733ffc421fe1da7468df94d0dabc3ab60a78835f6a1b39803c83e08c68c534480a7df685786c4adc34ab
+EBUILD ksh-1.0.3.ebuild 1592 BLAKE2B 5908cdc2e7465da096d99df41cc95ee983a0896d3633b44a7debaee9b10c944ff6e50728d115b468c7f9da228fca60dd469ede03f59f7cc08984c76a8615e6d4 SHA512 031f2c6798ea4148798c8ee3d6296bdbf4faf6d4d03542e24a8395b5ab6dacf407cb678f25f4e14ad414699f411565caba9f7d2470e8f7530cbf10961681b72a
+EBUILD ksh-9999.ebuild 1592 BLAKE2B 5908cdc2e7465da096d99df41cc95ee983a0896d3633b44a7debaee9b10c944ff6e50728d115b468c7f9da228fca60dd469ede03f59f7cc08984c76a8615e6d4 SHA512 031f2c6798ea4148798c8ee3d6296bdbf4faf6d4d03542e24a8395b5ab6dacf407cb678f25f4e14ad414699f411565caba9f7d2470e8f7530cbf10961681b72a
MISC metadata.xml 1489 BLAKE2B 8e0c5934f79c12702985656ddc95d5051c59f053c94bab595d3ec08aa336b9ab50de5e87aab7b47991c02aa6924932e59ab6fb4d3e38c60b139478a210d62cad SHA512 fa4422e4dbd25daed7ed21e66d06fb678ccbb3c37a62a090eddc9c3281e0d17310f5df5f172267f7a91935db4059b8dcdf78b88cd902d8f10f4f798e6264b0dc
diff --git a/app-shells/ksh/files/CVE-2019-14868.patch b/app-shells/ksh/files/CVE-2019-14868.patch
deleted file mode 100644
index d5c80566bafc..000000000000
--- a/app-shells/ksh/files/CVE-2019-14868.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-From c7de8b641266bac7c77942239ac659edfee9ecd2 Mon Sep 17 00:00:00 2001
-From: Kurtis Rader <krader@skepticism.us>
-Date: Thu, 12 Dec 2019 18:46:50 -0800
-Subject: [PATCH] Harden env var imports
-
----
- src/cmd/ksh93/sh/arith.c | 37 ++++++++++++++++++++++-----------
- src/cmd/ksh93/tests/subshell.sh | 23 ++++++++++++++++++++
-
-diff --git a/src/cmd/ksh93/sh/arith.c b/src/cmd/ksh93/sh/arith.c
-index 30b3067590a2..8e68cbdc868a 100644
---- a/src/cmd/ksh93/sh/arith.c
-+++ b/src/cmd/ksh93/sh/arith.c
-@@ -567,19 +567,32 @@ Sfdouble_t sh_strnum(Shell_t *shp, const char *str, char **ptr, int mode) {
- char *last;
-
- if (*str == 0) {
-- if (ptr) *ptr = (char *)str;
-- return 0;
-- }
-- errno = 0;
-- d = number(str, &last, shp->inarith ? 0 : 10, NULL);
-- if (*last) {
-- if (*last != '.' || last[1] != '.') {
-- d = strval(shp, str, &last, arith, mode);
-- Varsubscript = true;
-+ d = 0.0;
-+ last = (char *)str;
-+ } else {
-+ d = number(str, &last, shp->inarith ? 0 : 10, NULL);
-+ if (*last && !shp->inarith && sh_isstate(shp, SH_INIT)) {
-+ // This call is to handle "base#value" literals if we're importing untrusted env vars.
-+ d = number(str, &last, 0, NULL);
-+ }
-+ if (*last) {
-+ if (sh_isstate(shp, SH_INIT)) {
-+ // Initializing means importing untrusted env vars. Since the string does not appear
-+ // to be a recognized numeric literal give up. We can't safely call strval() since
-+ // that allows arbitrary expressions which would create a security vulnerability.
-+ d = 0.0;
-+ } else {
-+ if (*last != '.' || last[1] != '.') {
-+ d = strval(shp, str, &last, arith, mode);
-+ Varsubscript = true;
-+ }
-+ if (!ptr && *last && mode > 0) {
-+ errormsg(SH_DICT, ERROR_exit(1), e_lexbadchar, *last, str);
-+ }
-+ }
-+ } else if (d == 0.0 && *str == '-') {
-+ d = -0.0;
- }
-- if (!ptr && *last && mode > 0) errormsg(SH_DICT, ERROR_exit(1), e_lexbadchar, *last, str);
-- } else if (!d && *str == '-') {
-- d = -0.0;
- }
- if (ptr) *ptr = last;
- return d;
-diff --git a/src/cmd/ksh93/tests/subshell.sh b/src/cmd/ksh93/tests/subshell.sh
-index b63a8051ed5c..3faba475d6de 100644
---- a/src/cmd/ksh93/tests/subshell.sh
-+++ b/src/cmd/ksh93/tests/subshell.sh
-@@ -856,3 +856,26 @@ for exp in 65535 65536
- do got=$($SHELL -c 'x=$(printf "%.*c" '$exp' x); print ${#x}' 2>&1)
- [[ $got == $exp ]] || log_error "large command substitution failed" "$exp" "$got"
- done
-+
-+# ==========
-+# Verify that importing untrusted env vars does not allow evaluating arbitrary expressions but does
-+# recognize all integer literals recognized by ksh.
-+expect=8
-+actual=$(env SHLVL='7' $SHELL -c 'echo $SHLVL')
-+[[ $actual == $expect ]] || log_error "decimal int literal not recognized" "$expect" "$actual"
-+
-+expect=14
-+actual=$(env SHLVL='013' $SHELL -c 'echo $SHLVL')
-+[[ $actual == $expect ]] || log_error "leading zeros int literal not recognized" "$expect" "$actual"
-+
-+expect=4
-+actual=$(env SHLVL='2#11' $SHELL -c 'echo $SHLVL')
-+[[ $actual == $expect ]] || log_error "base#value int literal not recognized" "$expect" "$actual"
-+
-+expect=12
-+actual=$(env SHLVL='16#B' $SHELL -c 'echo $SHLVL')
-+[[ $actual == $expect ]] || log_error "base#value int literal not recognized" "$expect" "$actual"
-+
-+expect=1
-+actual=$(env SHLVL="2#11+x[\$($bin_echo DANGER WILL ROBINSON >&2)0]" $SHELL -c 'echo $SHLVL')
-+[[ $actual == $expect ]] || log_error "expression allowed on env var import" "$expect" "$actual"
diff --git a/app-shells/ksh/files/ksh-2020.0.0-ensure-user-set.patch b/app-shells/ksh/files/ksh-2020.0.0-ensure-user-set.patch
deleted file mode 100644
index 9f5d70f4d33c..000000000000
--- a/app-shells/ksh/files/ksh-2020.0.0-ensure-user-set.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From cb9f6d3498622b46de021a7f4798512d203747e9 Mon Sep 17 00:00:00 2001
-From: Kurtis Rader <krader@skepticism.us>
-Date: Sun, 1 Sep 2019 15:44:40 -0700
-Subject: [PATCH] Ensure USER is set when unit tests run
-
-Related #1391
----
- src/cmd/ksh93/tests/util/run_test.sh | 9 +++++++++
- 1 file changed, 9 insertions(+)
-
-diff --git a/src/cmd/ksh93/tests/util/run_test.sh b/src/cmd/ksh93/tests/util/run_test.sh
-index 20d24ed1fda..ebc74770cae 100644
---- a/src/cmd/ksh93/tests/util/run_test.sh
-+++ b/src/cmd/ksh93/tests/util/run_test.sh
-@@ -62,6 +62,15 @@ fi
- #
- export OS_NAME=$(uname -s | tr '[A-Z]' '[a-z]')
-
-+#
-+# Make sure $USER is set. A CI/CB environment might not set it.
-+# See https://github.com/att/ast/issues/1391
-+#
-+if [[ -z $USER ]]
-+then
-+ export USER=$(id -un)
-+fi
-+
- # TODO: Enable the `io` test on Travis macOS once we understand why it dies from an abort().
- # I'm not seeing that failure happen on either of my macOS 10.12 or 10.13 systems.
- if [[ $test_name == io && $OS_NAME == darwin && $CI == true ]]
diff --git a/app-shells/ksh/files/ksh-2020.0.0-skip-api-test.patch b/app-shells/ksh/files/ksh-2020.0.0-skip-api-test.patch
deleted file mode 100644
index f832d175454e..000000000000
--- a/app-shells/ksh/files/ksh-2020.0.0-skip-api-test.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From d89753b5d38482f4a3f17ba3b7d09ab07cfe7419 Mon Sep 17 00:00:00 2001
-From: Kurtis Rader <krader@skepticism.us>
-Date: Sun, 1 Sep 2019 13:47:40 -0700
-Subject: [PATCH] Skip API test if build type != debug
-
-Fixes #1390
----
- src/lib/libast/tests/misc/meson.build | 8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/src/lib/libast/tests/misc/meson.build b/src/lib/libast/tests/misc/meson.build
-index 67a178762fa..a4c864428d8 100644
---- a/src/lib/libast/tests/misc/meson.build
-+++ b/src/lib/libast/tests/misc/meson.build
-@@ -10,6 +10,12 @@ tests_to_skip = [
- ['freebsd', 'debug'],
- ]
-
-+# Non-debug build types affect the behavior of `backtrace()`. Which means it will almost certainly
-+# break the "debug" test. See https://github.com/att/ast/issues/1390.
-+if get_option('buildtype') != 'debug'
-+ tests_to_skip += [['*', 'debug']]
-+endif
-+
- foreach test_name: tests
- # If the platform doesn't have an execinfo.h header there is no point in trying to run the
- # debug.c unit test.
-@@ -18,7 +24,7 @@ foreach test_name: tests
- endif
- skip_test = false
- foreach skip : tests_to_skip
-- if system == skip[0] and test_name == skip[1]
-+ if ('*' == skip[0] or system == skip[0]) and test_name == skip[1]
- warning('skipping ' + test_name + ' on ' + system)
- skip_test = true
- # break # Not until meson 0.49
diff --git a/app-shells/ksh/ksh-1.0.3.ebuild b/app-shells/ksh/ksh-1.0.3.ebuild
new file mode 100644
index 000000000000..8fb7af0f3c4b
--- /dev/null
+++ b/app-shells/ksh/ksh-1.0.3.ebuild
@@ -0,0 +1,74 @@
+# Copyright 2021-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic toolchain-funcs
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/ksh93/ksh"
+else
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ MY_PV=$(ver_rs 3 - 4 .)
+ SRC_URI="https://github.com/ksh93/${PN}/archive/v${MY_PV}/ksh-v${MY_PV}.tar.gz"
+ S="${WORKDIR}/${PN}-${MY_PV}"
+fi
+
+DESCRIPTION="The Original ATT Korn Shell"
+HOMEPAGE="http://www.kornshell.com/"
+
+LICENSE="EPL-1.0"
+SLOT="0"
+
+src_prepare() {
+ default
+
+ # disable register for debugging
+ sed -i 1i"#define register" src/lib/libast/include/ast.h || die
+}
+
+src_compile() {
+ local extraflags=(
+ "-Wno-unknown-pragmas"
+ "-Wno-missing-braces"
+ "-Wno-unused-result"
+ "-Wno-return-type"
+ "-Wno-int-to-pointer-cast"
+ "-Wno-parentheses"
+ "-Wno-unused"
+ "-Wno-unused-but-set-variable"
+ "-Wno-cpp"
+ "-Wno-maybe-uninitialized"
+ "-Wno-lto-type-mismatch"
+ "-P"
+ )
+ append-cflags $(test-flags-CC ${extraflags[@]})
+ filter-flags '-fdiagnostics-color=always' # https://github.com/ksh93/ksh/issues/379
+ export CCFLAGS="${CFLAGS} -fno-strict-aliasing"
+
+ tc-export AR CC LD NM
+
+ sh bin/package make SHELL="${BROOT}"/bin/sh || die
+}
+
+src_test() {
+ # test tries to catch IO error
+ addwrite /proc/self/mem
+
+ # arith.sh uses A for tests
+ unset A
+
+ sh bin/shtests --compile || die
+}
+
+src_install() {
+ local myhost="$(sh bin/package host)"
+ cd "arch/${myhost}" || die
+
+ into /
+ dobin bin/ksh
+ dosym ksh /bin/rksh
+
+ newman man/man1/sh.1 ksh.1
+}
diff --git a/app-shells/ksh/ksh-2020.0.0-r1.ebuild b/app-shells/ksh/ksh-2020.0.0-r1.ebuild
deleted file mode 100644
index 5eb45fad5785..000000000000
--- a/app-shells/ksh/ksh-2020.0.0-r1.ebuild
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit meson ninja-utils
-
-if [[ ${PV} == 9999 ]]; then
- inherit git-r3
- EGIT_REPO_URI="https://github.com/att/ast"
-else
- KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86"
- MY_PV="${PV/_/-}"
- MY_P="${PN}-${MY_PV}"
- SRC_URI="https://github.com/att/ast/releases/download/${MY_PV}/${MY_P}.tar.gz"
- S="${WORKDIR}/${MY_P}"
-fi
-
-DESCRIPTION="The Original Korn Shell, 1993 revision (ksh93)"
-HOMEPAGE="https://github.com/att/ast"
-
-LICENSE="CPL-1.0 EPL-1.0"
-SLOT="0"
-
-RDEPEND="!app-shells/pdksh"
-
-PATCHES=(
- "${FILESDIR}"/ksh-2020.0.0-ensure-user-set.patch
- "${FILESDIR}"/ksh-2020.0.0-skip-api-test.patch
- "${FILESDIR}"/CVE-2019-14868.patch
-)
-
-src_test() {
- # https://bugs.gentoo.org/702570
- addwrite /proc/self
- local cmd=(
- meson test
- -C "${BUILD_DIR}"
- --num-processes "$(makeopts_jobs ${NINJAOPTS:-${MAKEOPTS}})"
- )
- echo "${cmd[@]}" >&2
- # https://github.com/att/ast/issues/1392
- env -u T "${cmd[@]}" || die
-}
-
-src_install() {
- meson_src_install
- dodir /bin
- mv "${ED}/usr/bin/ksh" "${ED}/bin/ksh" || die
-}
diff --git a/app-shells/ksh/ksh-9999.ebuild b/app-shells/ksh/ksh-9999.ebuild
index 8e02335af1d6..8fb7af0f3c4b 100644
--- a/app-shells/ksh/ksh-9999.ebuild
+++ b/app-shells/ksh/ksh-9999.ebuild
@@ -1,7 +1,7 @@
-# Copyright 2021 Gentoo Authors
+# Copyright 2021-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
inherit flag-o-matic toolchain-funcs
@@ -9,7 +9,7 @@ if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/ksh93/ksh"
else
- KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~riscv"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
MY_PV=$(ver_rs 3 - 4 .)
SRC_URI="https://github.com/ksh93/${PN}/archive/v${MY_PV}/ksh-v${MY_PV}.tar.gz"
S="${WORKDIR}/${PN}-${MY_PV}"