From 2728eb2c95c1214a864fe8b42f9b1dec37d0c73d Mon Sep 17 00:00:00 2001 From: Stefan Gaiselmann Date: Sun, 8 Nov 2020 14:06:53 +0100 Subject: [PATCH] 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. --- dot_sshrc.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dot_sshrc.tmpl b/dot_sshrc.tmpl index 40e2648..e3a284b 100644 --- a/dot_sshrc.tmpl +++ b/dot_sshrc.tmpl @@ -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