+++ This bug was initially created as a clone of Bug #1147645 +++
Description of problem:
ksh scripts that try to unset the BASH_FUNC_*() variables fail.
Version-Release number of selected component (if applicable):
ksh-20120801-22.el7
How reproducible:
100%
Steps to Reproduce:
[user@hose ~]$ a() {
> echo test
> }
[user@host ~]$ set | fgrep BASH_FUNC
[user@host ~]$ export -f a
[user@host ~]$ ksh
$ set | fgrep BASH_FUNC
BASH_FUNC_a()=$'() { echo test\n}'
BASH_FUNC_module()=$'() { eval `/usr/bin/modulecmd bash $*`\n}'
$
This might not be an issue, except if you try to unset it to clean up your environment:
$ unset 'BASH_FUNC_a()'
ksh: unset: BASH_FUNC_a(): invalid variable name
$
Actual results:
If perhaps you are being careful and use 'set -e' the entire script dies causing significant issues...
Expected results:
ksh should be able to clear it's environment...
Additional info:
'man ksh' describes that metacharacters are not valid in variable names:
; & ( ) | < > new-line space tab
The upstream bash fix is using %% for the fix (perhaps for this reason?)...
http://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-027
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://rhn.redhat.com/errata/RHBA-2016-2510.html