quirk in bash security check (privileged mode)
Did you know the name given to bash affects its behavior?
burrows@box:/tmp/priv$ ln -s /bin/bash sh burrows@box:/tmp/priv$ ln -s /bin/bash ba burrows@box:/tmp/priv$ ./ba -c "set -o | grep posix" posix off burrows@box:/tmp/priv$ ./sh -c "set -o | grep posix" posix on
This is a little odd, but it gets stranger.
Here is a snippet from the bash manpage discussing the -p option.
Turn on privileged mode. In this mode, the $ENV and $BASH_ENV files are not processed, shell functions are not inherited from the environment, and the SHELLOPTS, BASHOPTS, CDPATH, and GLOBIGNORE variables, if they appear in the environment, are ignored. If the shell is started with the effective user (group) id not equal to the real user (group) id, and the -p option is not supplied, these actions are taken and the effective user id is set to the real user id. If the -p option is supplied at
Continue reading →