summaryrefslogtreecommitdiff
path: root/share/rcm.sh.in
diff options
context:
space:
mode:
authorGravatar Mike Burns <mike@mike-burns.com>2014-01-27 13:41:55 +0100
committerGravatar Mike Burns <mike@mike-burns.com>2014-01-27 13:41:55 +0100
commitd9a6fa460e4987c3d07b8188f893eaa73896219b (patch)
treea6bfe03b18c42d6dd0aa70dfebe9970f7882684b /share/rcm.sh.in
parent4b163f5565269faadc64995a3a903fa28c65f7b3 (diff)
Unset the CDPATH before running the program
As reported in #23, you can trick `rcup` into installing into `.` with this `CDPATH`: export CDPATH=/tmp:. As described [online][1], it is a mistake to export the `CDPATH` environment variable to begin with. Since it is a one-liner to work around it, though, it's worth fixing. The workaround is to unset `CDPATH` at the beginning of the script. This does not affect the outside environment, it only affects the script and its functions. [1]: http://bosker.wordpress.com/2012/02/12/bash-scripters-beware-of-the-cdpath/
Diffstat (limited to 'share/rcm.sh.in')
-rw-r--r--share/rcm.sh.in2
1 files changed, 2 insertions, 0 deletions
diff --git a/share/rcm.sh.in b/share/rcm.sh.in
index 2af2418..7c0b6e2 100644
--- a/share/rcm.sh.in
+++ b/share/rcm.sh.in
@@ -18,6 +18,8 @@ INSTALL=rcup
ROOT_DIR=$HOME
HOSTNAME=`hostname -s`
+unset CDPATH
+
echo_n() {
printf "%s " "$*"
}