From ba926cda844bdd42b39d50fb926068f7a3dc4018 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Fri, 20 Feb 2009 21:04:25 +0100 Subject: [PATCH] Use . instead of source to load config files. This prevents a possible security problem with source, as it also searches the current directory. --- bash/rc | 2 +- shell/env | 4 ++-- zsh/env | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bash/rc b/bash/rc index 942ac8d..d03d05e 100644 --- a/bash/rc +++ b/bash/rc @@ -6,7 +6,7 @@ host=$(echo $(hostname) | sed -e 's/\..*$//') # Load environmental related settings used by all shells. if [ -f ~/.shell/env ]; then - source ~/.shell/env + . ~/.shell/env # Fallback functions as ~/.shell/env couldn't be loaded. else function source_debug() { diff --git a/shell/env b/shell/env index 5951153..9a31ff3 100644 --- a/shell/env +++ b/shell/env @@ -107,13 +107,13 @@ function source_config() { # If the file does exist then source it. if [ -f $source_file ]; then source_debug "source_config(): -> sourcing $source_file" - source $source_file + . $source_file # Otherwise load the .local file if it exists and .local files are # allowed. elif [ -f $source_file_local -a x$5 != xnolocal ]; then source_debug "source_config(): -> sourcing $source_file_local" - source $source_file_local + . $source_file_local else source_debug "source_config(): -> neither exists" fi diff --git a/zsh/env b/zsh/env index 365c01b..a413b57 100644 --- a/zsh/env +++ b/zsh/env @@ -6,7 +6,7 @@ host=${$(hostname)//.*/} # Load environmental related settings used by all shells. if [[ -f ~/.shell/env ]]; then - source ~/.shell/env + . ~/.shell/env # Fallback functions as ~/.shell/env couldn't be loaded. else function source_debug() { -- 2.44.1