summaryrefslogtreecommitdiffstats
path: root/retiolum/bin/update_tinc_hosts
diff options
context:
space:
mode:
authorroot <root@destroy>2013-01-31 20:35:35 +0100
committerroot <root@destroy>2013-01-31 20:35:35 +0100
commit4e540697f4fbd26c0ec047b763d2b0177008917e (patch)
treed2f0a824f3fbbdc3e03fed882df9e3dfaa641e7e /retiolum/bin/update_tinc_hosts
parentb0fae17212d9b5897302ec997a104e542b64d667 (diff)
//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.
Diffstat (limited to 'retiolum/bin/update_tinc_hosts')
-rwxr-xr-xretiolum/bin/update_tinc_hosts8
1 files changed, 6 insertions, 2 deletions
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}"