The bug was observed in Ubuntu 17.10. On executing the shell script, a condition would fail in the code, leading to an exit.
Description
Details
- Differential Revisions
- D11799: Bash file fix
D11800: Added -bash as an accepted whitelist value
Related Objects
The bug is primarily because of the way the bash has been executed, If the terminal is invoked as a login shell, the command
echo $0
has an output -bash, whereas if the bash is invoked as a non-login shell, the command has an output -/bin/bash
$0 has been used in an if condition which checks whether the bash is invoked or not. However, in case it is a login shell, the condition fails and leads to an exit
if [[ $(uname -s) != "Linux" ]] then echo echo "WARNING: uname -s returns something that is not 'Linux', this SDK is designed to be executed on Linux ONLY" echo return 1 &> /dev/null exit 1 fi
More details on this stackoverflow page
The bug is primarily because of the way the bash has been executed, If the terminal is invoked as a login shell, the command
echo $0
has an output -bash, whereas if the bash is invoked as a non-login shell, the command has an output -/bin/bash
$0 has been used in an if condition which checks whether the bash is invoked or not. However, in case it is a login shell, the condition fails and leads to an exit
if [[ $(uname -s) != "Linux" ]] then echo echo "WARNING: uname -s returns something that is not 'Linux', this SDK is designed to be executed on Linux ONLY" echo return 1 &> /dev/null exit 1 fi
More details on this stackoverflow page