From 5934935318347db1554749cbcc8dd045fb49b641 Mon Sep 17 00:00:00 2001 From: Austin English Date: Tue, 13 Oct 2015 05:39:14 -0500 Subject: [PATCH 1/1] use dpkg-divert to replace /usr/bin/wget instead of having a second wget in $PATH --- config/chroot_local-hooks/70-wget | 21 +++++++++++++++++++++ config/chroot_local-includes/usr/local/bin/wget | 8 -------- 2 files changed, 21 insertions(+), 8 deletions(-) create mode 100755 config/chroot_local-hooks/70-wget delete mode 100755 config/chroot_local-includes/usr/local/bin/wget diff --git a/config/chroot_local-hooks/70-wget b/config/chroot_local-hooks/70-wget new file mode 100755 index 0000000..c10cc80 --- /dev/null +++ b/config/chroot_local-hooks/70-wget @@ -0,0 +1,21 @@ +#!/bin/sh +set -e + +# We don't want the real binary to be in $PATH: +# Also note that wget uses the executable name in some help/error messages, +# so wget-real/etc. should be avoided. +mkdir -p /usr/lib/wget +dpkg-divert --add --rename --divert /usr/lib/wget/wget /usr/bin/wget + +# We don't want users or other applications using wget directly: +cat > /usr/bin/wget << 'EOF' +#!/bin/sh +unset http_proxy +unset HTTP_PROXY +unset https_proxy +unset HTTPS_PROXY + +exec torsocks /usr/lib/wget/wget --passive-ftp "$@" +EOF + +chmod 755 /usr/bin/wget diff --git a/config/chroot_local-includes/usr/local/bin/wget b/config/chroot_local-includes/usr/local/bin/wget deleted file mode 100755 index 0d94b53..0000000 --- a/config/chroot_local-includes/usr/local/bin/wget +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -unset http_proxy -unset HTTP_PROXY -unset https_proxy -unset HTTPS_PROXY - -exec torsocks /usr/bin/wget "$@" -- 2.6.1