From d9a6fa460e4987c3d07b8188f893eaa73896219b Mon Sep 17 00:00:00 2001 From: Mike Burns Date: Mon, 27 Jan 2014 13:41:55 +0100 Subject: 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/ --- share/rcm.sh.in | 2 ++ 1 file changed, 2 insertions(+) (limited to 'share/rcm.sh.in') 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 " "$*" } -- cgit v1.2.3