HomeClusterLabs Projects

Remove a bashism in ocf-shellfuncs.in

Description

Remove a bashism in ocf-shellfuncs.in

The function ocf_bash_has_xtracefd and its alias ocf_is_bash4 break non bash shells (in my case dash) because of how bash version is tested. Due to local environment idiosyncrasies it is perfectly possible to have dash running a script while the variable SHELL has a value of /bin/bash. It works fine for most of the code except the tracing functionality.

What I propose is to fix the version detection mechanism by first checking against the usually not exported variable BASH_VERSION.

Details

Provenance
Tristan Le Guern <tristan.leguern-presta@deveryware.com>Authored on Jul 22 2021, 7:01 AM
GitHub <noreply@github.com>Committed on Jul 22 2021, 7:01 AM
Parents
rR83cc15cfc14b: Merge pull request #1671 from Philipp-Reisner/NVMeTarget
Branches
Unknown
Tags
Unknown

Event Timeline