Bug 2050996
| Summary: | CentOS 9 Stream: export -f from /etc/profile not supported when using ksh as login shell | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Stefan Krüger <stadtkind2> |
| Component: | which | Assignee: | Than Ngo <than> |
| Status: | CLOSED ERRATA | QA Contact: | Jakub Haruda <jharuda> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | CentOS Stream | CC: | bstinson, efedin, jharuda, jwboyer |
| Target Milestone: | rc | Keywords: | Triaged |
| Target Release: | 9.1 | Flags: | pm-rhel:
mirror+
|
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | which-2.21-28.el9 | Doc Type: | No Doc Update |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-11-15 11:16:07 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Stefan Krüger
2022-02-05 16:29:38 UTC
The root cause is `/etc/profile.d/which2.sh` from package `which-2.21-27.el9.x86_64`:
```bash
[...]
which_opt="-f" # <--
which_shell="$(cat /proc/$$/comm)" # <-- yields ksh93 for ksh93 shell
if [ "$which_shell" = "ksh" ] || [ "$which_shell" = "mksh" ] || [ "$which_shell" = "zsh" ] ; then # "ksh" != "ksh93"
which_declare="typeset -f"
which_opt=""
fi
which ()
{
(alias; eval ${which_declare}) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot "$@"
}
export which_declare
export ${which_opt} which
```
I guess the fix would be adding `|| [ "$which_shell" = "ksh93" ]`.
it is fixed in which-2.21-28.el9 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 (which bug fix and enhancement update), 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://access.redhat.com/errata/RHBA-2022:8305 |