Secured .sshrc sourcing.

SOURCE_PROFILE and SOURCE_BASHRC are used to enable sourcing of .bashrc
and .profile.
This is due to an alternative way to source .sshrc from .bashrc, an
infinite loop must be avoided if using 's' alias with sourcing .sshrc.
This commit is contained in:
Stefan Gaiselmann 2020-11-08 14:06:53 +01:00
parent fc4d11d502
commit 2728eb2c95

View File

@ -1,10 +1,10 @@
#
# sshrc will be called byaliased ssh command 's'.
#
if [ -f $HOME/.profile ]; then
if [ -f $HOME/.profile ] && [ "$SOURCE_PROFILE" = "true" ]; then
source $HOME/.profile
fi
if [ -f $HOME/.bashrc ]; then
if [ -f $HOME/.bashrc ] && [ "$SOURCE_BASHRC" = "true" ]; then
source $HOME/.bashrc
fi