* update bash to 5.2.032-2

This commit is contained in:
Alexander Baldeck 2024-09-21 23:20:17 +02:00
parent 29a8093391
commit 6e62b06450
4 changed files with 644 additions and 33 deletions

176
bash/.SRCINFO Normal file
View File

@ -0,0 +1,176 @@
pkgbase = bash
pkgdesc = The GNU Bourne Again shell
pkgver = 5.2.032
pkgrel = 2
url = https://www.gnu.org/software/bash/bash.html
install = bash.install
arch = x86_64
license = GPL-3.0-or-later
depends = readline
depends = libreadline.so
depends = glibc
depends = ncurses
optdepends = bash-completion: for tab completion
provides = sh
backup = etc/bash.bashrc
backup = etc/bash.bash_logout
backup = etc/skel/.bashrc
backup = etc/skel/.bash_profile
backup = etc/skel/.bash_logout
source = https://ftp.gnu.org/gnu/bash/bash-5.2.tar.gz
source = https://ftp.gnu.org/gnu/bash/bash-5.2.tar.gz.sig
source = bash-5.2_p15-configure-clang16.patch
source = bash-5.2_p15-random-ub.patch
source = bash-5.2_p21-configure-strtold.patch
source = bash-5.2_p21-wpointer-to-int.patch
source = bash-5.2_p32-memory-leaks.patch
source = bash-5.2_p32-read-delimiter-in-invalid-mbchar.patch
source = dot.bashrc
source = dot.bash_profile
source = dot.bash_logout
source = system.bashrc
source = system.bash_logout
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-001
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-001.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-002
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-002.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-003
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-003.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-004
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-004.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-005
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-005.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-006
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-006.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-007
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-007.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-008
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-008.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-009
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-009.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-010
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-010.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-011
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-011.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-012
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-012.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-013
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-013.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-014
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-014.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-015
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-015.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-016
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-016.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-017
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-017.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-018
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-018.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-019
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-019.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-020
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-020.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-021
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-021.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-022
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-022.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-023
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-023.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-024
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-024.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-025
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-025.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-026
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-026.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-027
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-027.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-028
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-028.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-029
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-029.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-030
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-030.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-031
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-031.sig
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-032
source = https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-032.sig
validpgpkeys = 7C0135FB088AAF6C66C650B9BB5869F064EA74AB
b2sums = 51b196e710794ebad8eac28c31c93eb99ac1a7db30919a13271e39e1cb66a0672f242df75fc7d71627ea873dfbce53ec35c0c56a71c5167143070a7811343fd9
b2sums = SKIP
b2sums = 5ef332cd2847f46e351e5db6dda79d01d9853f5eda9762deeba0450c2bd400eec549bbb85696777b687f64d0977daac4883d6ce3f1e26cec0d5f73e8ee97f000
b2sums = adab09c3f2ce3697e3659e01266120155714b80263bd125808edf556a354291af615540189553b1c32a2d462ac41e28a9df8fb9f7d963a3ca3629d297a46e62d
b2sums = 83ec6ff756543ee44c18902f2d30dd662a84237b9594a7e0cfc21a1c16fce49e37cf67729b3a17d59cc978cb6675e04457e3b6b0909d94cb234a1dde96f7c9ea
b2sums = 0c7f5eb5b697abf15c1d17888a973e44d0ead1f095778b41841a6a1937a5b9e7ce5fa6a05e4404504990b0a244fdecfc12ce7c33ee7d67b4c837435e9bfe2b57
b2sums = 373aa3be1f0a6bc65403cde63cbc4dcd612336e86b1cae918670a99e8ca639c665ac7efb467ec8823a62cec0a71c485bd3fda4bbf058d759498377f5cfe90f51
b2sums = ab7fe139630be59b26a72f92f22e4a2b556594d341d82b0f15f99880724f5ea5cfd912a8de6b6e1db902c14d65395c74a03379e3e01ce69bb4512c681518301d
b2sums = 61cc3b7c9e85ae29b48518a2579896cb037153184a233cb5636d8dce4c2a2fded88624c9d5a986d86fdd4b0d521828b510c7a0d16b3c8b95cfca8d4c0a74da17
b2sums = 2d53f99e485218ed47f2e40907023645594ac8ffcf00d0569050d54a8f4dabe0a2bdcab515a45b663283c2e6299d805b923ea7b7b789c6a4150c37a98a5b117c
b2sums = dbfe5c1aaea94419305c1f8c9b54b94eab515260910f2309360ff702a27032faa34514e70b31adbb1e41bd912d4e43a610939cb07565f43e05dd19813a81752e
b2sums = e349dba4f9d8b9d5eceb928b6fad89bfd2ec052fbb4dece49ba7c012a7e930196f786115e39e11c4f2d59edd169c9d417e7eab4fd59667ed60b750901df55ac3
b2sums = fc924345d5dab10f1ae328bca3cf1053ddff557e074a6e6dff771bd813b93838980ed5d0f20d3a0584cbd1994332fcacc8a6b0e98f7aa376139198ea6a4d6f5a
b2sums = d00a8b4fb3babf52c67a3e345158c1f70b5b45e5a54100a6671d96f9cfbf893143d5a23df7e7c5f4d5c0bd650519fb0c447b2304db2d6e0751dfffa651a7cf49
b2sums = SKIP
b2sums = b3b7e2511823a0527aeed5af2c8d9f44e5ab079fa8b3f48fe84b35a14327d0143e14e04316c16bfbe2a1cac0c7fcf7ab5058a2b00be38ed3243b53b786e969f1
b2sums = SKIP
b2sums = d9f358c240d998a331d6aa4513b02191b1fbe7e875f8e96e531fca8968f84d0f4672d3644bbd6258f2aca0cabd2deb6159bbf98ba201e667d61353113a3e8240
b2sums = SKIP
b2sums = 159fbb7a6dddece1d4db2b38d6de591366ae07eb237ffa8ad61c933560160561736a4e70b8bd5441cd75ae88e8d4a29869367838b169a4533d06d9d3c345d554
b2sums = SKIP
b2sums = 5afdbe8fa644e1b7108600a7ecc0a8e5774a837f3acff45bfe5eff9ffca1b9e5ab09f19083464a9cfaee4bd6c9b351275c5baef5331c43dbfbc642e226ca8af3
b2sums = SKIP
b2sums = 68c37f5f5164685d0d1f25a05d5584128b6d8d83efa271aaaf80c82e2ec71bc78a3961ebd5d5d6620ef6a3dcca7e6494f0e666b651056faef9c0ea0866b3b94e
b2sums = SKIP
b2sums = 028808fa9eac85e66ad942fff07ca6595b578911b3f3f99ae7d67289bd6c27936bbce66fea160e8c3e2fcc6bb18f6429121685c550a815ed992f9d0c757391ae
b2sums = SKIP
b2sums = b46dde58525b727565efeca99cf4279fd2510382430b227ed233e7fc78c433b8d7eb2f1f7e4d31174118e9cc5bb8c43656e78583dc7fde15381aa63001b78277
b2sums = SKIP
b2sums = 36a1a5be9166f436077aff8c8dc8e6b8745b6b07408e5abc3756846d199799cee22e825ae992f3db5f3885157fb37b64f1159b3bc8d0bd1d16c5980c9f74e092
b2sums = SKIP
b2sums = 0c61991d38c95b25411e793a09855c18f536ddfae237b09d01ac7898d4638b8747fc58d2c2f35c651026bd6957cb04780382256417e0bbde288aa4e05cd80530
b2sums = SKIP
b2sums = e1b246634ee7b1bba7e4b140bc730fa6770f5988ed215ea1ba646eea630789b863333fec471e99c28b142b74539639f37239487b02b877ea360f519bdaee2894
b2sums = SKIP
b2sums = b7c4888a3af4e9ee37f3d83d15bad1360209eb412ba1e963c4be90b0b1d62e0c860f61f5cf7de3b7b1a34d341101069ffa5a65efc7dc5857dac296444321b9d2
b2sums = SKIP
b2sums = a8c5a2d526a049b36677a485d8e12a6ccbabc6118ba760e2e08785650b89ae13b155242c7c5f557fb229ffcdea6ff6d5b0de1d0c66b7f2a1711bee7d01a4b663
b2sums = SKIP
b2sums = 990e6566c446ce030d1333a05de9027a994054e983bf414e9aa09505c94d0615f1726494e139320b0d1c923c680565b2cf4249bd062e9e8aa98b226386c03c26
b2sums = SKIP
b2sums = 038f03bc543297a3f2e7612afdee7b27eb5d65d7f81c22976936211f4a80acd9f0faf1ba6c56e20fc653b877a448ab7872b5488da3684952682d80c752227ab2
b2sums = SKIP
b2sums = 675b70e1df1083021fb6336e50d10012dc02e1a80865a64579256319ca98c8282af20e7210ef9d993f97718c7bfed2315f23edac04e6f3af65a1e08cd5f7ef2e
b2sums = SKIP
b2sums = 461f2f6543501306faa5decd98211699f0ce84eea5a1225145dc401ec0ca893c9d8021359c04af4dec265e7d247f2fbb70cfe8d5382e3c38fd2774e017de4aed
b2sums = SKIP
b2sums = 89f95c096f8e487e2a1a00541087d157321b125ae93dc656af0cf6ead9158401a028f5c838c4b81aeb95e7c4951a3b4dfb1a88e08297a03236c0ad36eb6710d2
b2sums = SKIP
b2sums = bcf683825da1e56692d7024748501cc582e623168fc1a8713ef3b4eb284222f6bf9144871d6357464a1c8c031f105ca6cac6cc591b5463d8b72eb139fcf044f0
b2sums = SKIP
b2sums = de3e38dbb2395c765767aed516ae3d143e3187a44964f90c587f41f93447c43515481e3c9bd562175d750d0dfb9e4e3eacb25c31f8bf54168fa544c938955eae
b2sums = SKIP
b2sums = cc2d886da8c51eb7bdbed694423eae29dc05dc2c7bd0cd41b9ee3acbc56ef135043bb48275c4162d33d2d4051a0a8b27f3aec097335b9d15e38fd841a6793f71
b2sums = SKIP
b2sums = 2e0cc2255c0313ab85547363d7dd060d460db44131b698235275413c51e79cdc33b77064f84d56e75a0951fc62f947482c2f317a0d4f732822a4ffaed943a9cd
b2sums = SKIP
b2sums = 9727ad8cf219ba906021f833cacbbccf6c5b9c94decf861a5f40627680ac3d19d65eaeafecd575545dc7eb538f27b0ecc55a7462b49d226751ad14fb2f40e825
b2sums = SKIP
b2sums = f9113fcb1b8ee8d96744e45f020fd8ec49546d6a29883544f4d4a4ef1087b764de6e7c37c760ac709370cdace9619aec84f03713be5e6bc9a9e90d97dd35caa0
b2sums = SKIP
b2sums = 5d18e00cc44710f078037f25c61741a078bb0fc906d6d5555e581e093d9e99be71f7f06fc0d139f4f25d40f5f854378031aff6e63d26ead55fe6cca626df50bd
b2sums = SKIP
b2sums = ebe3bc47dadf5d689258c5ccf9883838d3383dc43bec68d2a6767b6348cf1515a98ec9e445c3110e8eb0d87e742c20a0d4ddb70649ec94217f55aad7d18552af
b2sums = SKIP
b2sums = b76ce03456e064f17db00e9026aa53656a063c195faa02c7d51da8d173f7525fe5411bf526f19ee9e717ee1ec957de7e73f5af851a68d5cb554f2c4492ab3844
b2sums = SKIP
b2sums = 58fdeecf6dd685103c7dc0e7c200cae65206e5fb3360d798b9cec05fc935ebae139bdf142f6018c9837d1780eb7c5cecff0a945369c14fa575e6801c46a15a31
b2sums = SKIP
b2sums = 01ddb0acc5b6067e729320692284d61735ace62eeede81a74b7628fe6899da61d921a11bd0d22d0e6f2e241e7b0cb64591654a34a33916739e35e23d5cc6f5bd
b2sums = SKIP
b2sums = d0cf114642393eb2e2d060eac339674c8ce10af4d54bbcee0f450854d27373ede9dd159caf6d05fc69429ad357d666b47f6781ef590287f33a535b2c26d8754d
b2sums = SKIP
b2sums = dac378115906e21fc754267c42e129e2374c9b63f879d1717d79930589618d4d8d17821b2f529d1851db7567d3efdfb0410c18e6869047e3d87443b29d507289
b2sums = SKIP
b2sums = 55aab849da0fcc69ab3516d9d7ff2858b5f15cbeaddf66282f43f272b52d646c2c41c2ceef632a2ae8f13c25d92e85f49fbc6de989ed4f6ac4bb7bea7fc59a5d
b2sums = SKIP
pkgname = bash

View File

@ -1,35 +1,47 @@
# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: Giancarlo Razzolini <grazzolini@archlinux.org>
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Giancarlo Razzolini <grazzolini@archlinux.org>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: Aaron Griffin <aaron@archlinux.org>
pkgname=bash
_basever=5.2
_patchlevel=026
_patchlevel=032
pkgver=${_basever}.${_patchlevel}
pkgrel=5
pkgrel=2
pkgdesc='The GNU Bourne Again shell'
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
license=('GPL-3.0-or-later')
url='https://www.gnu.org/software/bash/bash.html'
backup=(etc/bash.bash{rc,_logout} etc/skel/.bash{rc,_profile,_logout})
depends=(readline libreadline.so glibc ncurses)
backup=(
etc/bash.bash{rc,_logout}
etc/skel/.bash{rc,_profile,_logout}
)
depends=(
readline
libreadline.so
glibc
ncurses
)
optdepends=('bash-completion: for tab completion')
provides=('sh')
install=bash.install
source=(https://ftp.gnu.org/gnu/bash/bash-$_basever.tar.gz{,.sig}
bash-5.2_p15-configure-clang16.patch
bash-5.2_p15-random-ub.patch
bash-5.2_p21-configure-strtold.patch
bash-5.2_p21-wpointer-to-int.patch
bash-5.2_p26-memory-leaks.patch
dot.bashrc
dot.bash_profile
dot.bash_logout
system.bashrc
system.bash_logout)
source=(
https://ftp.gnu.org/gnu/bash/bash-$_basever.tar.gz{,.sig}
bash-5.2_p15-configure-clang16.patch
bash-5.2_p15-random-ub.patch
bash-5.2_p21-configure-strtold.patch
bash-5.2_p21-wpointer-to-int.patch
bash-5.2_p32-memory-leaks.patch
bash-5.2_p32-read-delimiter-in-invalid-mbchar.patch
dot.bashrc
dot.bash_profile
dot.bash_logout
system.bashrc
system.bash_logout
)
validpgpkeys=('7C0135FB088AAF6C66C650B9BB5869F064EA74AB') # Chet Ramey
if [[ $((10#${_patchlevel})) -gt 0 ]]; then
@ -43,7 +55,8 @@ b2sums=('51b196e710794ebad8eac28c31c93eb99ac1a7db30919a13271e39e1cb66a0672f242df
'adab09c3f2ce3697e3659e01266120155714b80263bd125808edf556a354291af615540189553b1c32a2d462ac41e28a9df8fb9f7d963a3ca3629d297a46e62d'
'83ec6ff756543ee44c18902f2d30dd662a84237b9594a7e0cfc21a1c16fce49e37cf67729b3a17d59cc978cb6675e04457e3b6b0909d94cb234a1dde96f7c9ea'
'0c7f5eb5b697abf15c1d17888a973e44d0ead1f095778b41841a6a1937a5b9e7ce5fa6a05e4404504990b0a244fdecfc12ce7c33ee7d67b4c837435e9bfe2b57'
'1b9f08054b28fa0e73b7b3d4da2674efd75b3ce11392a078d5072ba8e466f4a9c504892f9a1f2f62e4dc39b22050e68d42bcbae8ebe537df699d0c884c89a0b9'
'373aa3be1f0a6bc65403cde63cbc4dcd612336e86b1cae918670a99e8ca639c665ac7efb467ec8823a62cec0a71c485bd3fda4bbf058d759498377f5cfe90f51'
'ab7fe139630be59b26a72f92f22e4a2b556594d341d82b0f15f99880724f5ea5cfd912a8de6b6e1db902c14d65395c74a03379e3e01ce69bb4512c681518301d'
'61cc3b7c9e85ae29b48518a2579896cb037153184a233cb5636d8dce4c2a2fded88624c9d5a986d86fdd4b0d521828b510c7a0d16b3c8b95cfca8d4c0a74da17'
'2d53f99e485218ed47f2e40907023645594ac8ffcf00d0569050d54a8f4dabe0a2bdcab515a45b663283c2e6299d805b923ea7b7b789c6a4150c37a98a5b117c'
'dbfe5c1aaea94419305c1f8c9b54b94eab515260910f2309360ff702a27032faa34514e70b31adbb1e41bd912d4e43a610939cb07565f43e05dd19813a81752e'
@ -100,10 +113,22 @@ b2sums=('51b196e710794ebad8eac28c31c93eb99ac1a7db30919a13271e39e1cb66a0672f242df
'5d18e00cc44710f078037f25c61741a078bb0fc906d6d5555e581e093d9e99be71f7f06fc0d139f4f25d40f5f854378031aff6e63d26ead55fe6cca626df50bd'
'SKIP'
'ebe3bc47dadf5d689258c5ccf9883838d3383dc43bec68d2a6767b6348cf1515a98ec9e445c3110e8eb0d87e742c20a0d4ddb70649ec94217f55aad7d18552af'
'SKIP'
'b76ce03456e064f17db00e9026aa53656a063c195faa02c7d51da8d173f7525fe5411bf526f19ee9e717ee1ec957de7e73f5af851a68d5cb554f2c4492ab3844'
'SKIP'
'58fdeecf6dd685103c7dc0e7c200cae65206e5fb3360d798b9cec05fc935ebae139bdf142f6018c9837d1780eb7c5cecff0a945369c14fa575e6801c46a15a31'
'SKIP'
'01ddb0acc5b6067e729320692284d61735ace62eeede81a74b7628fe6899da61d921a11bd0d22d0e6f2e241e7b0cb64591654a34a33916739e35e23d5cc6f5bd'
'SKIP'
'd0cf114642393eb2e2d060eac339674c8ce10af4d54bbcee0f450854d27373ede9dd159caf6d05fc69429ad357d666b47f6781ef590287f33a535b2c26d8754d'
'SKIP'
'dac378115906e21fc754267c42e129e2374c9b63f879d1717d79930589618d4d8d17821b2f529d1851db7567d3efdfb0410c18e6869047e3d87443b29d507289'
'SKIP'
'55aab849da0fcc69ab3516d9d7ff2858b5f15cbeaddf66282f43f272b52d646c2c41c2ceef632a2ae8f13c25d92e85f49fbc6de989ed4f6ac4bb7bea7fc59a5d'
'SKIP')
prepare() {
cd $pkgname-$_basever
cd "${pkgname}-${_basever}"
for (( _p=1; _p<=$((10#${_patchlevel})); _p++ )); do
local patch="bash${_basever//.}-$(printf "%03d" $_p)"
patch -Np0 -i ../"${patch}"
@ -114,11 +139,12 @@ prepare() {
patch -Np0 -i ../bash-5.2_p15-random-ub.patch
patch -Np0 -i ../bash-5.2_p21-configure-strtold.patch
patch -Np0 -i ../bash-5.2_p21-wpointer-to-int.patch
patch -Np0 -i ../bash-5.2_p26-memory-leaks.patch
patch -Np0 -i ../bash-5.2_p32-memory-leaks.patch
patch -Np0 -i ../bash-5.2_p32-read-delimiter-in-invalid-mbchar.patch
}
build() {
cd $pkgname-$_basever
cd "${pkgname}-${_basever}"
_bashconfig=(-DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/bin\"\'
-DSTANDARD_UTILS_PATH=\'\"/usr/bin\"\'
@ -132,29 +158,27 @@ build() {
--with-curses \
--enable-readline \
--without-bash-malloc \
--with-installed-readline \
--enable-extended-glob-default
--with-installed-readline
make
}
check() {
make -C $pkgname-$_basever check
make -C "${pkgname}-${_basever}" check
}
package() {
make -C $pkgname-$_basever DESTDIR="$pkgdir" install
ln -s bash "$pkgdir/usr/bin/sh"
ln -s bash "$pkgdir/usr/bin/rbash"
make -C "${pkgname}-${_basever}" DESTDIR="$pkgdir" install
ln -s bash "${pkgdir}/usr/bin/sh"
ln -s bash "${pkgdir}/usr/bin/rbash"
# system-wide configuration files
install -Dm644 system.bashrc "$pkgdir/etc/bash.bashrc"
install -Dm644 system.bash_logout "$pkgdir/etc/bash.bash_logout"
install -Dm644 system.bashrc "${pkgdir}/etc/bash.bashrc"
install -Dm644 system.bash_logout "${pkgdir}/etc/bash.bash_logout"
# user configuration file skeletons
install -dm755 "$pkgdir/etc/skel/"
install -m644 dot.bashrc "$pkgdir/etc/skel/.bashrc"
install -m644 dot.bash_profile "$pkgdir/etc/skel/.bash_profile"
install -m644 dot.bash_logout "$pkgdir/etc/skel/.bash_logout"
install -dm755 "${pkgdir}/etc/skel/"
install -m644 dot.bashrc "${pkgdir}/etc/skel/.bashrc"
install -m644 dot.bash_profile "${pkgdir}/etc/skel/.bash_profile"
install -m644 dot.bash_logout "${pkgdir}/etc/skel/.bash_logout"
}
# vim: ts=2 sw=2 et:

View File

@ -0,0 +1,114 @@
https://lists.gnu.org/archive/html/bug-bash/2024-01/msg00036.html
https://lists.gnu.org/archive/html/bug-bash/2024-01/txtm8yNNPR9RQ.txt
For evalstring.c:
* https://lists.gnu.org/archive/html/bug-bash/2024-01/msg00011.html
* https://git.savannah.gnu.org/cgit/bash.git/diff/builtins/evalstring.c?h=devel&id=81f7b44564cd1510788035cea7c59631865a7db2&dt=1#n766
From 711ab85262884f2b91f09eceb9aefd0e2426ce67 Mon Sep 17 00:00:00 2001
From: Grisha Levit <grishalevit@gmail.com>
Date: Sat, 3 Jun 2023 16:51:26 -0400
Subject: [PATCH] various leaks
Found mostly by normal usage running a no-bash-malloc build with clang's
LeakSanitizer enabled. So far seems to provide very accurate results.
* arrayfunc.c
- quote_compound_array_word: make sure to free VALUE
- bind_assoc_var_internal: if assigning to a dynamic variable, make sure
to free the key (usually assoc_insert would do it)
* bashline.c
- bash_command_name_stat_hook: free original *NAME if we are going to
change what it points to (what the callers seem to expect)
* builtins/evalstring.c
- parse_and_execute: make sure to dispose of the parsed command
resulting from a failed function import attempt
- open_redir_file: if we did not get a pointer to pass back the expanded
filename, make sure to free the name
* examples/loadables/stat.c
- loadstat: bind_assoc_variable does not free its VALUE argument so make
sure to do it
* subst.c
- param_expand: free temp1 value for codepaths that don't do it
---
arrayfunc.c | 6 +++++-
bashline.c | 1 +
builtins/evalstring.c | 4 ++++
examples/loadables/stat.c | 1 +
subst.c | 2 ++
5 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/arrayfunc.c b/arrayfunc.c
index 2c05d15b..8ba64084 100644
--- arrayfunc.c
+++ arrayfunc.c
@@ -208,7 +208,10 @@ bind_assoc_var_internal (entry, hash, key, value, flags)
newval = make_array_variable_value (entry, 0, key, value, flags);
if (entry->assign_func)
- (*entry->assign_func) (entry, newval, 0, key);
+ {
+ (*entry->assign_func) (entry, newval, 0, key);
+ FREE (key);
+ }
else
assoc_insert (hash, key, newval);
@@ -985,6 +988,7 @@ quote_compound_array_word (w, type)
if (t != w+ind)
free (t);
strcpy (nword + i, value);
+ free (value);
return nword;
}
diff --git a/bashline.c b/bashline.c
index c85b05b6..bd7548cc 100644
--- bashline.c
+++ bashline.c
@@ -1928,6 +1928,7 @@ bash_command_name_stat_hook (name)
result = search_for_command (cname, 0);
if (result)
{
+ FREE (*name);
*name = result;
return 1;
}
diff --git a/examples/loadables/stat.c b/examples/loadables/stat.c
index 1e60e7b6..ed5c9764 100644
--- examples/loadables/stat.c
+++ examples/loadables/stat.c
@@ -349,6 +349,7 @@ loadstat (vname, var, fname, flags, fmt, sp)
key = savestring (arraysubs[i]);
value = statval (i, fname, flags, fmt, sp);
v = bind_assoc_variable (var, vname, key, value, ASS_FORCE);
+ free (value);
}
return 0;
}
diff --git a/subst.c b/subst.c
index 1ac6eb2d..ff0602da 100644
--- subst.c
+++ subst.c
@@ -10727,6 +10727,7 @@ comsub:
{
chk_atstar (temp, quoted, pflags, quoted_dollar_at_p, contains_dollar_at);
tdesc = parameter_brace_expand_word (temp, SPECIAL_VAR (temp, 0), quoted, pflags, 0);
+ free (temp1);
if (tdesc == &expand_wdesc_error || tdesc == &expand_wdesc_fatal)
return (tdesc);
ret = tdesc;
@@ -10739,6 +10740,7 @@ comsub:
{
set_exit_status (EXECUTION_FAILURE);
report_error (_("%s: invalid variable name for name reference"), temp);
+ free (temp1);
return (&expand_wdesc_error); /* XXX */
}
else
--
2.43.0

View File

@ -0,0 +1,297 @@
From 0432ec33408ac124b620c44416c9c58f0c10b63b Mon Sep 17 00:00:00 2001
From: Kerin Millar <kfm@plushkava.net>
Date: Fri, 23 Aug 2024 04:14:36 +0100
Subject: [PATCH] Backport fix for issue with read delimiter in invalid
mutibyte char
This addresses a regression introduced by 5.0. Consider the following
test case.
for i in {194..245}; do printf -v o %o "$i"; printf "\\$o\\n"; done |
while read -r; do declare -p REPLY; done
BEFORE
declare -- REPLY=$'\302\n\303\n\304\n\305\n\306\n\307\n\310\n\311\n\312\
n\313\n\314\n\315\n\316\n\317\n\320\n\321\n\322\n\323\n\324\n\325\n\326\
n\327\n\330\n\331\n\332\n\333\n\334\n\335\n\336\n\337\n\340\n\341\n\342\
n\343\n\344\n\345\n\346\n\347\n\350\n\351\n\352\n\353\n\354\n\355\n\356\
n\357\n\360\n\361\n\362\n\363\n\364\n\365'
AFTER
declare -- REPLY=$'\302'
declare -- REPLY=$'\303'
declare -- REPLY=$'\304'
declare -- REPLY=$'\305'
declare -- REPLY=$'\306'
declare -- REPLY=$'\307'
declare -- REPLY=$'\310'
declare -- REPLY=$'\311'
declare -- REPLY=$'\312'
declare -- REPLY=$'\313'
declare -- REPLY=$'\314'
declare -- REPLY=$'\315'
declare -- REPLY=$'\316'
declare -- REPLY=$'\317'
declare -- REPLY=$'\320'
declare -- REPLY=$'\321'
declare -- REPLY=$'\322'
declare -- REPLY=$'\323'
declare -- REPLY=$'\324'
declare -- REPLY=$'\325'
declare -- REPLY=$'\326'
declare -- REPLY=$'\327'
declare -- REPLY=$'\330'
declare -- REPLY=$'\331'
declare -- REPLY=$'\332'
declare -- REPLY=$'\333'
declare -- REPLY=$'\334'
declare -- REPLY=$'\335'
declare -- REPLY=$'\336'
declare -- REPLY=$'\337'
declare -- REPLY=$'\340'
declare -- REPLY=$'\341'
declare -- REPLY=$'\342'
declare -- REPLY=$'\343'
declare -- REPLY=$'\344'
declare -- REPLY=$'\345'
declare -- REPLY=$'\346'
declare -- REPLY=$'\347'
declare -- REPLY=$'\350'
declare -- REPLY=$'\351'
declare -- REPLY=$'\352'
declare -- REPLY=$'\353'
declare -- REPLY=$'\354'
declare -- REPLY=$'\355'
declare -- REPLY=$'\356'
declare -- REPLY=$'\357'
declare -- REPLY=$'\360'
declare -- REPLY=$'\361'
declare -- REPLY=$'\362'
declare -- REPLY=$'\363'
declare -- REPLY=$'\364'
declare -- REPLY=$'\365'
Signed-off-by: Kerin Millar <kfm@plushkava.net>
---
builtins/read.def | 25 ++++++++++++----
externs.h | 1 +
lib/sh/zread.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 94 insertions(+), 6 deletions(-)
diff --git builtins/read.def builtins/read.def
index ddd91d32..53b4bd81 100644
--- builtins/read.def
+++ builtins/read.def
@@ -130,7 +130,7 @@ static void set_readline_timeout PARAMS((sh_timer *t, time_t, long));
#endif
static SHELL_VAR *bind_read_variable PARAMS((char *, char *, int));
#if defined (HANDLE_MULTIBYTE)
-static int read_mbchar PARAMS((int, char *, int, int, int));
+static int read_mbchar PARAMS((int, char *, int, int, int, int));
#endif
static void ttyrestore PARAMS((struct ttsave *));
@@ -806,7 +806,7 @@ add_char:
else
# endif
if (locale_utf8locale == 0 || ((c & 0x80) != 0))
- i += read_mbchar (fd, input_string, i, c, unbuffered_read);
+ i += read_mbchar (fd, input_string, i, c, delim, unbuffered_read);
}
#endif
@@ -1064,10 +1064,10 @@ bind_read_variable (name, value, flags)
#if defined (HANDLE_MULTIBYTE)
static int
-read_mbchar (fd, string, ind, ch, unbuffered)
+read_mbchar (fd, string, ind, ch, delim, unbuffered)
int fd;
char *string;
- int ind, ch, unbuffered;
+ int ind, ch, delim, unbuffered;
{
char mbchar[MB_LEN_MAX + 1];
int i, n, r;
@@ -1101,8 +1101,21 @@ read_mbchar (fd, string, ind, ch, unbuffered)
mbchar[i++] = c;
continue;
}
- else if (ret == (size_t)-1 || ret == (size_t)0 || ret > (size_t)0)
- break;
+ else if (ret == (size_t)-1)
+ {
+ /* If we read a delimiter character that makes this an invalid
+ multibyte character, we can't just add it to the input string
+ and treat it as a byte. We need to push it back so a subsequent
+ zread will pick it up. */
+ if (c == delim)
+ {
+ zungetc (c);
+ mbchar[--i] = '\0'; /* unget the delimiter */
+ }
+ break; /* invalid multibyte character */
+ }
+ else if (ret == (size_t)0 || ret > (size_t)0)
+ break; /* valid multibyte character */
}
mbchar_return:
diff --git externs.h externs.h
index 931dba9c..1b70a13b 100644
--- externs.h
+++ externs.h
@@ -536,6 +536,7 @@ extern ssize_t zreadintr PARAMS((int, char *, size_t));
extern ssize_t zreadc PARAMS((int, char *));
extern ssize_t zreadcintr PARAMS((int, char *));
extern ssize_t zreadn PARAMS((int, char *, size_t));
+extern int zungetc PARAMS((int));
extern void zreset PARAMS((void));
extern void zsyncfd PARAMS((int));
diff --git lib/sh/zread.c lib/sh/zread.c
index dafb7f60..7cfbb288 100644
--- lib/sh/zread.c
+++ lib/sh/zread.c
@@ -41,6 +41,10 @@ extern int errno;
# define ZBUFSIZ 4096
#endif
+#ifndef EOF
+# define EOF -1
+#endif
+
extern int executing_builtin;
extern void check_signals_and_traps (void);
@@ -48,6 +52,11 @@ extern void check_signals (void);
extern int signal_is_trapped (int);
extern int read_builtin_timeout (int);
+int zungetc (int);
+
+/* Provide one character of pushback whether we are using read or zread. */
+static int zpushedchar = -1;
+
/* Read LEN bytes from FD into BUF. Retry the read on EINTR. Any other
error causes the loop to break. */
ssize_t
@@ -59,6 +68,15 @@ zread (fd, buf, len)
ssize_t r;
check_signals (); /* check for signals before a blocking read */
+
+ /* If we pushed a char back, return it immediately */
+ if (zpushedchar != -1)
+ {
+ *buf = (unsigned char)zpushedchar;
+ zpushedchar = -1;
+ return 1;
+ }
+
/* should generalize into a mechanism where different parts of the shell can
`register' timeouts and have them checked here. */
while (((r = read_builtin_timeout (fd)) < 0 || (r = read (fd, buf, len)) < 0) &&
@@ -95,6 +113,14 @@ zreadretry (fd, buf, len)
ssize_t r;
int nintr;
+ /* If we pushed a char back, return it immediately */
+ if (zpushedchar != -1)
+ {
+ *buf = (unsigned char)zpushedchar;
+ zpushedchar = -1;
+ return 1;
+ }
+
for (nintr = 0; ; )
{
r = read (fd, buf, len);
@@ -118,6 +144,15 @@ zreadintr (fd, buf, len)
size_t len;
{
check_signals ();
+
+ /* If we pushed a char back, return it immediately */
+ if (zpushedchar != -1)
+ {
+ *buf = (unsigned char)zpushedchar;
+ zpushedchar = -1;
+ return 1;
+ }
+
return (read (fd, buf, len));
}
@@ -135,6 +170,14 @@ zreadc (fd, cp)
{
ssize_t nr;
+ /* If we pushed a char back, return it immediately */
+ if (zpushedchar != -1 && cp)
+ {
+ *cp = (unsigned char)zpushedchar;
+ zpushedchar = -1;
+ return 1;
+ }
+
if (lind == lused || lused == 0)
{
nr = zread (fd, lbuf, sizeof (lbuf));
@@ -160,6 +203,14 @@ zreadcintr (fd, cp)
{
ssize_t nr;
+ /* If we pushed a char back, return it immediately */
+ if (zpushedchar != -1 && cp)
+ {
+ *cp = (unsigned char)zpushedchar;
+ zpushedchar = -1;
+ return 1;
+ }
+
if (lind == lused || lused == 0)
{
nr = zreadintr (fd, lbuf, sizeof (lbuf));
@@ -186,6 +237,13 @@ zreadn (fd, cp, len)
{
ssize_t nr;
+ if (zpushedchar != -1 && cp)
+ {
+ *cp = zpushedchar;
+ zpushedchar = -1;
+ return 1;
+ }
+
if (lind == lused || lused == 0)
{
if (len > sizeof (lbuf))
@@ -204,6 +262,22 @@ zreadn (fd, cp, len)
return 1;
}
+int
+zungetc (c)
+ int c;
+{
+ if (zpushedchar == -1)
+ {
+ zpushedchar = c;
+ return c;
+ }
+
+ if (c == EOF || lind == 0)
+ return (EOF);
+ lbuf[--lind] = c; /* XXX */
+ return c;
+}
+
void
zreset ()
{
--
2.45.2