summaryrefslogtreecommitdiff
path: root/app-shells/bash
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-01-08 11:28:34 +0000
committerV3n3RiX <venerix@redcorelinux.org>2021-01-08 11:28:34 +0000
commit24fd814c326e282c4321965c31f341dad77e270d (patch)
tree033d63b33c21a3209964ab56005bb9bdd523630d /app-shells/bash
parent129160ec854dca4c3fedb5bcfbcb56930371da0f (diff)
gentoo resync : 08.01.2021
Diffstat (limited to 'app-shells/bash')
-rw-r--r--app-shells/bash/Manifest10
-rw-r--r--app-shells/bash/bash-4.4_p23-r2.ebuild4
-rw-r--r--app-shells/bash/bash-5.0_p11-r1.ebuild266
-rw-r--r--app-shells/bash/bash-5.0_p18.ebuild4
-rw-r--r--app-shells/bash/bash-5.1.ebuild4
-rw-r--r--app-shells/bash/bash-5.1_p4.ebuild4
-rw-r--r--app-shells/bash/files/bash-5.0_p11-disable_priv_mode.patch85
7 files changed, 365 insertions, 12 deletions
diff --git a/app-shells/bash/Manifest b/app-shells/bash/Manifest
index 244dc167a058..58dedc62d1b3 100644
--- a/app-shells/bash/Manifest
+++ b/app-shells/bash/Manifest
@@ -59,6 +59,7 @@ AUX bash-4.4-set-SHOBJ_STATUS.patch 410 BLAKE2B beddcd4ea00cf6814615896e9842a607
AUX bash-4.x-deferred-heredocs.patch 1181 BLAKE2B 3afb0e6d6e9b1220133a862bc44c13a5989c4d21ab456098ee19f8dc8adfd0dfff6c83e3c42fc622487b05a33d614c08e69f400796ff6f1ee9c56c74a94f6867 SHA512 167d6344cef96f2c0e732450c3174c5cd74df822f71c415d145d531fb192fc9c684dcdff1a982b87824becd2bdbdf3fb5ab47dcaa4c7a35905b42d25ad0710aa
AUX bash-5.0-history-append.patch 1150 BLAKE2B cc3d4c2303b37b14da2cbb3130db0c2fa65cdc7f7f8d0a4413042a898c4c48afbedcca03c9dbfc525ab191ddc2b4258fb976a28830e03490011f89a1361974b4 SHA512 9c2fb93c67a5da1e97b293db4b26469fd6813e2cfc8ffd776042529878b96312644d8dc247887d6171c89c0853d552e9f7d5d2c0b2f3d05c25c15e17e6706999
AUX bash-5.0-syslog-history-extern.patch 376 BLAKE2B d883d3c3adbf8f4d19ecc3c2790754a7f6972682d1679b07d5bc599bdbfc019ba8ad4d1271ec550b59447db0a02f1219c9e6057a0b1c1c6c52f7750a746a07bf SHA512 c8dd17bdd8ccbd73061a7cbcb7351195e703a2c5fc6faf288ec3721fc6e526d88dd4b2201f87078a92ca134b98214ccfa935f82f585322f72e9a41fd51842b6a
+AUX bash-5.0_p11-disable_priv_mode.patch 2651 BLAKE2B 9abd8497cdafa8f4b5fa2db887c0c67304077609da8894a43b5debe6d2223f2f5cb009879ad1a17a589e492273d5bfe139676451a68cd461bd82926d5f029e85 SHA512 112e71b85a7edec4898c940ba278ed2c1f443af7d658b10dec12ced8473fb2111fe772b2ceea93ec319038cee25ca275bc39216364150f52cdefe2155cdb78d7
AUX bash-5.1-parallel_make.patch 472 BLAKE2B fa6432b4a92f868eae1162f39de2860c94970c90a7209b445099bf1771d06b3545ebec13e7b18754b016f0d822bfc01983e994d25ca00bab3ab4494e27d7b3a3 SHA512 9137f58f568142fb1d8cb554adbc382fbdf317b5090f609672d2c4a1dde4a4a5c0d1ca3df6b28c8c196b660956e9bc34bbf1b76f8133d1099b65f4648f6051b9
AUX bash_logout 205 BLAKE2B b8c0266c3d1e31a714304a2b3b33389f042ae5bd497379f9b15ce31d47d1e3da73ba6536023953b00efe27b687e2ff45d94e3f01a13acc824dc12e31552c5b94 SHA512 7234250c03fc920996a381f9daef9e2d8ab1e1a29acdebed6669d8e0fe1c872a7fa343adf7d9ddc81225b0cd9eb223ba7ad1ff42448aff057fc6d6baa8f04a7d
AUX bashrc 3566 BLAKE2B c8013229792e6ece99d08615543d34935b8ef1604cfc48ad651ea64ae60cb39b6d945c46fa046d4fdd453a70eb46d065113defb11aa167f1a18f5b4246363828 SHA512 d7cda4637aa57f6a5500a421b7a0767a7ef9f526cbeb601f9cbe71164628189ca80258402d97074909b1437b65b708f1be3b867d66243022f628f7a0473ac98a
@@ -406,8 +407,9 @@ EBUILD bash-4.0_p44.ebuild 4374 BLAKE2B 29142cdd914c8990d87e0a84e17e27c270e76e4d
EBUILD bash-4.1_p17.ebuild 4129 BLAKE2B b985ccdc6a54a13ae8a025ca914ebe4658cb1607852699c52e1d0b46d3804b11f1388bb2a87d498eca8e9f309d1b370421a7b863992110d3aaec91d3cc564e72 SHA512 dbfdb9ebb3c7892c5f7652c6749521576fe48153e2229e2d976555f111a58e7a2a2bd46cc56d807375c0d9743d81460a7c6addc36cf0a1e309d3c34cd5e8077e
EBUILD bash-4.2_p53.ebuild 4312 BLAKE2B 3c38e3c0cbacb50e00221f3450dd3b1e18f8c23b86ee481ffd87789e7ab00d686d0aac1690a0a36d85b7d1af09d74bcb9c3203947f2282c3b8758bf9f1724926 SHA512 51a53607941c6dfd5e78deab48e8788b3004a2fb90f57b531cf6eae9484be33a9d3ffac6a09c9bdd0ded9511a2da5f60e03f17231525652d8c898ae0fe0e4dd5
EBUILD bash-4.3_p48-r2.ebuild 5596 BLAKE2B 89b41a1e0e072dcee85e09b50ce10e4a9b6fb6efdac740982332aa029968ac3382ddb695148e361912ad44bd8a29aa5d972343ef403adc1efe406efd8c6c9248 SHA512 1857bc7a01ad80757271db0e3a404d6b171341a99d9cac4059d3f7ff0a88cd4ead1ab871098ed6ca8cf9ad19e4bf0f48c103d1958b4bf5eace410de404c1d258
-EBUILD bash-4.4_p23-r2.ebuild 5686 BLAKE2B bf2c3b9d1be2c0fa58be409351c4d4afabf2c6c249452bfcf83e37a49a4de080c9adac75a699c50bf4e404ba6d8ceba2d1e3e1e9c179474a92d454c2c6658ef9 SHA512 0e448b093c95ab06a8e4f1f3f775c0ea3334d745d5aa81d3f1aea8d98040925fe2e64e2f0aedf1a99adf405ff94c495cc95da5db160ff52570db6e94a2149e63
-EBUILD bash-5.0_p18.ebuild 7295 BLAKE2B b981fbce314b942e51c502d9e1b087176eefd72bef6b04d41f6b9714de6b90c42263c5f9dd2e6ade14bc807f1fa586bc28874fa8b973f0bbe14915c8b6818b47 SHA512 f354ce4fb88e7ba5c418e321b74f4f897c7eecf5e0c060ff0d7aac3fff9ce6e42afc2f4b0a7981f676b1977d10d9a5951d9480099785c7e431683046ee5d7af5
-EBUILD bash-5.1.ebuild 7338 BLAKE2B 2ec653c7c6f4d0ebb66d17f59968d7ecc3b3300d24877b42b3ed1cd700f62024f2fdfe39b227d998ce7a7103cef776ffbbd1cd471c484954b915fdcecc0203c6 SHA512 8575352e49ef4ca6095d6fc53dc0d7c83a91cfc36afa1720c6660c631ae62e49b43504b7c372adc06c99c0c50e5f6d028d6afbaaafe7466496eefd0bbdb6b3b0
-EBUILD bash-5.1_p4.ebuild 7286 BLAKE2B ae6bc36df56177c7fa0739423702ef98613e1e4be076b246d2b877c1163b79d37f00d6f1b8bf10004ff139dd1b621a4fc0b17345029a8b2839f244c109e5fec5 SHA512 58e7d60bb07c2a6cc592fce2fa1d9e4fd197a9da78542ae5522b846670a9a644980520b5d74b368b3019a7a37693303e92bbf45ca05764917737bd00d984c39a
+EBUILD bash-4.4_p23-r2.ebuild 5675 BLAKE2B e024d196ea9d17cccd70284f1db07d00252d862f257c2a4484705258820493a8d35c894858a7ac31f505a0ba7eb23a4a0c6126a049bff5154582db7ae081f18d SHA512 e6afcbe5db9c1160d600edead7bbb72dba88f427dcd0c34023cfb1ce2857475a5e5cb152e89398a92d187c32599fc44783805d50256e4fcb3c53984eb33522ff
+EBUILD bash-5.0_p11-r1.ebuild 7470 BLAKE2B a66bef1f71fa4f1c58c8dc691516e0d4ab85fa6ec92bde64ca2f5f59bde33d92b9bcead202efb01e73b7ff41b5b4765cb458a6285be9d6ab64be26756f602b2f SHA512 aab51808a60afb7ad39c6b25a32dc628104dd084f190698fe3b52bbe04483193fd49e23faa8f7aff3aaa062a15ee6c964af0eecb0d14ce918f8057336f705324
+EBUILD bash-5.0_p18.ebuild 7284 BLAKE2B 8a3781c21e3022604316428792c90a51c9da8641bac747e1cd2e018dc32a556be1a35b52196b4c723114a2e745da662cbeba8bbe1e62fb407bee9a8641c417da SHA512 aa6fc8edba678dbbfca3f4d2159f7c5b82475f4e2b35f65a72a1c456518464fde38a3facd369bb6f40d306496a99ae6689fa303aa98d9d91d832a53d75969ad9
+EBUILD bash-5.1.ebuild 7327 BLAKE2B f6a4f27c58e267bbbee3bef19231acbee6e5d9258af5468619da425032c03f6a9eb1d8a009319d2d7ccfee170f83ed4edda72c1e495a94375a73d6d25ce7bb9b SHA512 42a40ecb51c4a4834e1d11070bb7a218eb115bea9fece77d3c50f2d614ffb72c9a5412b784fc76879f2d70e46ec7b2a7a854669c04150780669cbce619897567
+EBUILD bash-5.1_p4.ebuild 7275 BLAKE2B 017818d2a5347f8daaea32470f3d365de2359c7c65ae6d361f119a7805353bccb4d539f0f414975050ea0169b7591ed993e7a313b3271fed03340f2cc2e5bd51 SHA512 94131f52fffa504048e85be4f3ad6cec37242c363717edd9a400825dea59e8d4fb3083d7286ea0dc876c5c44751db8ec545f37d7e4dd8b03eb76bfdd982fc6f1
MISC metadata.xml 734 BLAKE2B 242fda202379209b74e12c1726c4f4aa487eb09423d2249d13cae38cb9b077a285beff221a824647c826c39f7400178cd04d6082915ad9c23287ea70da9ef961 SHA512 a9301e8d2347e0cf90a97325d9a705076150c00609d28338e5d7d72c135468e4f0531b2a4077b69679ae6ccf89eee691e0e5f0748caab60689f5f017afb544f1
diff --git a/app-shells/bash/bash-4.4_p23-r2.ebuild b/app-shells/bash/bash-4.4_p23-r2.ebuild
index 267493db7c8c..f039711106da 100644
--- a/app-shells/bash/bash-4.4_p23-r2.ebuild
+++ b/app-shells/bash/bash-4.4_p23-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -46,7 +46,7 @@ fi
LICENSE="GPL-3"
SLOT="${MY_PV}"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline"
DEPEND="
diff --git a/app-shells/bash/bash-5.0_p11-r1.ebuild b/app-shells/bash/bash-5.0_p11-r1.ebuild
new file mode 100644
index 000000000000..a2adb6b02922
--- /dev/null
+++ b/app-shells/bash/bash-5.0_p11-r1.ebuild
@@ -0,0 +1,266 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic toolchain-funcs multilib prefix
+
+# Official patchlevel
+# See ftp://ftp.cwru.edu/pub/bash/bash-5.0-patches/
+PLEVEL=${PV##*_p}
+MY_PV=${PV/_p*}
+MY_PV=${MY_PV/_/-}
+MY_P=${PN}-${MY_PV}
+is_release() {
+ case ${PV} in
+ *_alpha*|*_beta*|*_rc*) return 1 ;;
+ *) return 0 ;;
+ esac
+}
+[[ ${PV} != *_p* ]] && PLEVEL=0
+patches() {
+ local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
+ [[ ${plevel} -eq 0 ]] && return 1
+ eval set -- {1..${plevel}}
+ set -- $(printf "${pn}${pv/\.}-%03d " "$@")
+ if [[ ${opt} == -s ]] ; then
+ echo "${@/#/${DISTDIR}/}"
+ else
+ local u
+ for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
+ printf "${u}/${pn}-${pv}-patches/%s " "$@"
+ done
+ fi
+}
+
+# The version of readline this bash normally ships with.
+READLINE_VER="8.0"
+
+DESCRIPTION="The standard GNU Bourne again shell"
+HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
+if is_release ; then
+ SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
+else
+ SRC_URI="ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline"
+
+DEPEND="
+ >=sys-libs/ncurses-5.2-r2:0=
+ nls? ( virtual/libintl )
+ readline? ( >=sys-libs/readline-${READLINE_VER}:0= )
+"
+RDEPEND="
+ ${DEPEND}
+ !<sys-apps/portage-2.1.6.7_p1
+"
+# we only need yacc when the .y files get patched (bash42-005)
+#DEPEND+=" virtual/yacc"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+ # Patches from Chet sent to bashbug ml
+ "${FILESDIR}"/${PN}-5.0-history-append.patch
+ "${FILESDIR}"/${PN}-5.0-syslog-history-extern.patch
+ # fix CVE-2019-18276 #702488
+ "${FILESDIR}"/${PN}-5.0_p11-disable_priv_mode.patch
+)
+
+pkg_setup() {
+ if is-flag -malign-double ; then #7332
+ eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
+ eerror "as it breaks LFS (struct stat64) on x86."
+ die "remove -malign-double from your CFLAGS mr ricer"
+ fi
+ if use bashlogger ; then
+ ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
+ ewarn "This will log ALL output you enter into the shell, you have been warned."
+ fi
+}
+
+src_unpack() {
+ unpack ${MY_P}.tar.gz
+}
+
+src_prepare() {
+ # Include official patches
+ [[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)
+
+ # Clean out local libs so we know we use system ones w/releases.
+ if is_release ; then
+ rm -rf lib/{readline,termcap}/*
+ touch lib/{readline,termcap}/Makefile.in # for config.status
+ sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
+ fi
+
+ # Prefixify hardcoded path names. No-op for non-prefix.
+ hprefixify pathnames.h.in
+
+ # Avoid regenerating docs after patches #407985
+ sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
+ touch -r . doc/*
+
+ eapply -p0 "${PATCHES[@]}"
+ eapply_user
+}
+
+src_configure() {
+ local myconf=(
+ --disable-profiling
+ --docdir='$(datarootdir)'/doc/${PF}
+ --htmldir='$(docdir)/html'
+ --with-curses
+ $(use_enable mem-scramble)
+ $(use_enable net net-redirections)
+ $(use_enable readline)
+ $(use_enable readline bang-history)
+ $(use_enable readline history)
+ $(use_with afs)
+ $(use_with mem-scramble bash-malloc)
+ )
+
+ # For descriptions of these, see config-top.h
+ # bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
+ append-cppflags \
+ -DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \
+ -DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \
+ -DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \
+ -DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \
+ -DNON_INTERACTIVE_LOGIN_SHELLS \
+ -DSSH_SOURCE_BASHRC \
+ $(use bashlogger && echo -DSYSLOG_HISTORY)
+
+ # Don't even think about building this statically without
+ # reading Bug 7714 first. If you still build it statically,
+ # don't come crying to us with bugs ;).
+ #use static && export LDFLAGS="${LDFLAGS} -static"
+ use nls || myconf+=( --disable-nls )
+
+ # Historically, we always used the builtin readline, but since
+ # our handling of SONAME upgrades has gotten much more stable
+ # in the PM (and the readline ebuild itself preserves the old
+ # libs during upgrades), linking against the system copy should
+ # be safe.
+ # Exact cached version here doesn't really matter as long as it
+ # is at least what's in the DEPEND up above.
+ export ac_cv_rl_version=${READLINE_VER%%_*}
+
+ # Force linking with system curses ... the bundled termcap lib
+ # sucks bad compared to ncurses. For the most part, ncurses
+ # is here because readline needs it. But bash itself calls
+ # ncurses in one or two small places :(.
+
+ if is_release ; then
+ # Use system readline only with released versions.
+ myconf+=( --with-installed-readline=. )
+ fi
+
+ if use plugins; then
+ append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
+ else
+ # Disable the plugins logic by hand since bash doesn't
+ # provide a way of doing it.
+ export ac_cv_func_dl{close,open,sym}=no \
+ ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
+ sed -i \
+ -e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
+ configure || die
+ fi
+ tc-export AR #444070
+ econf "${myconf[@]}"
+}
+
+src_compile() {
+ emake
+
+ if use plugins ; then
+ emake -C examples/loadables all others
+ fi
+}
+
+src_install() {
+ local d f
+
+ default
+
+ dodir /bin
+ mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
+ dosym bash /bin/rbash
+
+ insinto /etc/bash
+ doins "${FILESDIR}"/bash_logout
+ doins "$(prefixify_ro "${FILESDIR}"/bashrc)"
+ keepdir /etc/bash/bashrc.d
+ insinto /etc/skel
+ for f in bash{_logout,_profile,rc} ; do
+ newins "${FILESDIR}"/dot-${f} .${f}
+ done
+
+ local sed_args=(
+ -e "s:#${USERLAND}#@::"
+ -e '/#@/d'
+ )
+ if ! use readline ; then
+ sed_args+=( #432338
+ -e '/^shopt -s histappend/s:^:#:'
+ -e 's:use_color=true:use_color=false:'
+ )
+ fi
+ sed -i \
+ "${sed_args[@]}" \
+ "${ED}"/etc/skel/.bashrc \
+ "${ED}"/etc/bash/bashrc || die
+
+ if use plugins ; then
+ exeinto /usr/$(get_libdir)/bash
+ doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
+ insinto /usr/include/bash-plugins
+ doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
+ fi
+
+ if use examples ; then
+ for d in examples/{functions,misc,scripts,startup-files} ; do
+ exeinto /usr/share/doc/${PF}/${d}
+ insinto /usr/share/doc/${PF}/${d}
+ for f in ${d}/* ; do
+ if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
+ doexe ${f}
+ else
+ doins ${f}
+ fi
+ done
+ done
+ fi
+
+ doman doc/*.1
+ newdoc CWRU/changelog ChangeLog
+ dosym bash.info /usr/share/info/bashref.info
+}
+
+pkg_preinst() {
+ if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
+ mkdir -p "${EROOT}"/etc/bash
+ mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
+ fi
+
+ if [[ -L ${EROOT}/bin/sh ]] ; then
+ # rewrite the symlink to ensure that its mtime changes. having /bin/sh
+ # missing even temporarily causes a fatal error with paludis.
+ local target=$(readlink "${EROOT}"/bin/sh)
+ local tmp=$(emktemp "${EROOT}"/bin)
+ ln -sf "${target}" "${tmp}"
+ mv -f "${tmp}" "${EROOT}"/bin/sh
+ fi
+}
+
+pkg_postinst() {
+ # If /bin/sh does not exist, provide it
+ if [[ ! -e ${EROOT}/bin/sh ]] ; then
+ ln -sf bash "${EROOT}"/bin/sh
+ fi
+}
diff --git a/app-shells/bash/bash-5.0_p18.ebuild b/app-shells/bash/bash-5.0_p18.ebuild
index b0555c11ddbb..e22d27a3b3ba 100644
--- a/app-shells/bash/bash-5.0_p18.ebuild
+++ b/app-shells/bash/bash-5.0_p18.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -46,7 +46,7 @@ fi
LICENSE="GPL-3"
SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline"
DEPEND="
diff --git a/app-shells/bash/bash-5.1.ebuild b/app-shells/bash/bash-5.1.ebuild
index d79991068230..1d3db2119d51 100644
--- a/app-shells/bash/bash-5.1.ebuild
+++ b/app-shells/bash/bash-5.1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -47,7 +47,7 @@ fi
LICENSE="GPL-3"
SLOT="0"
[[ "${PV}" == *_rc* ]] || \
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline"
DEPEND="
diff --git a/app-shells/bash/bash-5.1_p4.ebuild b/app-shells/bash/bash-5.1_p4.ebuild
index aac2b6b67f8e..d3193239c760 100644
--- a/app-shells/bash/bash-5.1_p4.ebuild
+++ b/app-shells/bash/bash-5.1_p4.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -47,7 +47,7 @@ fi
LICENSE="GPL-3"
SLOT="0"
[[ "${PV}" == *_rc* ]] || \
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline"
DEPEND="
diff --git a/app-shells/bash/files/bash-5.0_p11-disable_priv_mode.patch b/app-shells/bash/files/bash-5.0_p11-disable_priv_mode.patch
new file mode 100644
index 000000000000..9a05c8b8613f
--- /dev/null
+++ b/app-shells/bash/files/bash-5.0_p11-disable_priv_mode.patch
@@ -0,0 +1,85 @@
+diff -urP ../bash-5.0.orig/config.h.in config.h.in
+--- ../bash-5.0.orig/config.h.in 2018-12-04 09:54:17.000000000 -0700
++++ config.h.in 2019-12-10 11:34:42.157926317 -0700
+@@ -1,6 +1,6 @@
+ /* config.h -- Configuration file for bash. */
+
+-/* Copyright (C) 1987-2009,2011-2012 Free Software Foundation, Inc.
++/* Copyright (C) 1987-2009,2011-2012,2013-2019 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash, the Bourne Again SHell.
+
+@@ -807,6 +807,14 @@
+ #undef HAVE_SETREGID
+ #undef HAVE_DECL_SETREGID
+
++/* Define if you have the setregid function. */
++#undef HAVE_SETRESGID
++#undef HAVE_DECL_SETRESGID
++
++/* Define if you have the setresuid function. */
++#undef HAVE_SETRESUID
++#undef HAVE_DECL_SETRESUID
++
+ /* Define if you have the setvbuf function. */
+ #undef HAVE_SETVBUF
+
+diff -urP ../bash-5.0.orig/configure configure
+--- ../bash-5.0.orig/configure 2019-01-02 07:43:31.000000000 -0700
++++ configure 2019-12-10 11:34:42.166926317 -0700
+@@ -10281,6 +10281,17 @@
+ #define HAVE_DECL_SETREGID $ac_have_decl
+ _ACEOF
+
++ac_fn_c_check_decl "$LINENO" "" "ac_cv_have_decl_" "$ac_includes_default"
++if test "x$ac_cv_have_decl_" = xyes; then :
++ ac_have_decl=1
++else
++ ac_have_decl=0
++fi
++
++cat >>confdefs.h <<_ACEOF
++#define HAVE_DECL_ $ac_have_decl
++_ACEOF
++(setresuid, setresgid)
+ ac_fn_c_check_decl "$LINENO" "strcpy" "ac_cv_have_decl_strcpy" "$ac_includes_default"
+ if test "x$ac_cv_have_decl_strcpy" = xyes; then :
+ ac_have_decl=1
+diff -urP ../bash-5.0.orig/configure.ac configure.ac
+--- ../bash-5.0.orig/configure.ac 2019-01-02 07:39:11.000000000 -0700
++++ configure.ac 2019-12-10 11:34:42.168926317 -0700
+@@ -810,6 +810,7 @@
+ AC_CHECK_DECLS([printf])
+ AC_CHECK_DECLS([sbrk])
+ AC_CHECK_DECLS([setregid])
++AC_CHECK_DECLS[(setresuid, setresgid])
+ AC_CHECK_DECLS([strcpy])
+ AC_CHECK_DECLS([strsignal])
+
+diff -urP ../bash-5.0.orig/shell.c shell.c
+--- ../bash-5.0.orig/shell.c 2018-12-06 09:28:21.000000000 -0700
++++ shell.c 2019-12-10 11:34:42.170926317 -0700
+@@ -1293,7 +1293,11 @@
+ {
+ int e;
+
++#if HAVE_DECL_SETRESUID
++ if (setresuid (current_user.uid, current_user.uid, current_user.uid) < 0)
++#else
+ if (setuid (current_user.uid) < 0)
++#endif
+ {
+ e = errno;
+ sys_error (_("cannot set uid to %d: effective uid %d"), current_user.uid, current_user.euid);
+@@ -1302,7 +1306,11 @@
+ exit (e);
+ #endif
+ }
++#if HAVE_DECL_SETRESGID
++ if (setresgid (current_user.gid, current_user.gid, current_user.gid) < 0)
++#else
+ if (setgid (current_user.gid) < 0)
++#endif
+ sys_error (_("cannot set gid to %d: effective gid %d"), current_user.gid, current_user.egid);
+
+ current_user.euid = current_user.uid;