setup: unset bash exported function

Fix: #45239
This commit is contained in:
Đoàn Trần Công Danh 2023-07-26 07:57:26 +07:00
parent dc28f145c1
commit 4fcd6a35a9
1 changed files with 6 additions and 0 deletions

View File

@ -5,6 +5,12 @@
for var in $(awk 'BEGIN{for (i in ENVIRON) {print i}}' </dev/null); do for var in $(awk 'BEGIN{for (i in ENVIRON) {print i}}' </dev/null); do
# Those variables in chroot.sh will be kept # Those variables in chroot.sh will be kept
case "$var" in case "$var" in
BASH_FUNC_*'%%')
# bash exported functions
var="${var%??}"
var="${var#BASH_FUNC_}"
unset -f "$var"
;;
XBPS_* | IN_CHROOT | CHROOT_READY | SOURCE_DATE_EPOCH) XBPS_* | IN_CHROOT | CHROOT_READY | SOURCE_DATE_EPOCH)
# xbps-src specific # xbps-src specific
;; ;;