From 4e540697f4fbd26c0ec047b763d2b0177008917e Mon Sep 17 00:00:00 2001 From: root Date: Thu, 31 Jan 2013 20:35:35 +0100 Subject: //retiolum update_tinc_hosts: don't modify PATH Don't modify PATH but explicitly locate required executables (i.e. hosts), so no other executables from //retiolum/bin can sneak into update_tinc_hosts. --- retiolum/bin/update_tinc_hosts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'retiolum/bin') diff --git a/retiolum/bin/update_tinc_hosts b/retiolum/bin/update_tinc_hosts index 7be30c2a..ce1be497 100755 --- a/retiolum/bin/update_tinc_hosts +++ b/retiolum/bin/update_tinc_hosts @@ -7,8 +7,12 @@ if test "${nosudo-false}" != true -a `id -u` != 0; then exit 23 # go to hell fi -DIRNAME=`dirname $0` -export PATH="`readlink -f $DIRNAME`:$PATH" +list_hosts="$( + basename="`readlink -f "$0"`" + bindir="`dirname "$basename"`" + echo "$bindir/hosts" +)" +hosts() { "$list_hosts"; } hosts="${hosts-/etc/hosts}" -- cgit v1.2.3