aboutsummaryrefslogtreecommitdiff
path: root/unicorn_mode
diff options
context:
space:
mode:
authorhexcoder- <heiko@hexco.de>2020-04-04 18:38:38 +0200
committervan Hauser <vh@thc.org>2020-04-09 10:23:37 +0200
commit1eb81fdf36a165ea2703b6ccdc96ec2ece9dbfc1 (patch)
treed5b3762f9540fa20dadfef342a4f1051181a4c89 /unicorn_mode
parent62b6af693d4802b776a5103895bb49559e835607 (diff)
downloadafl++-1eb81fdf36a165ea2703b6ccdc96ec2ece9dbfc1.tar.gz
unicorn_mode build script: find setuptools more reliably
Diffstat (limited to 'unicorn_mode')
-rw-r--r--[-rwxr-xr-x]unicorn_mode/build_unicorn_support.sh19
1 files changed, 16 insertions, 3 deletions
diff --git a/unicorn_mode/build_unicorn_support.sh b/unicorn_mode/build_unicorn_support.sh
index a8999dca..0d915238 100755..100644
--- a/unicorn_mode/build_unicorn_support.sh
+++ b/unicorn_mode/build_unicorn_support.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
#
# american fuzzy lop++ - unicorn mode build script
# ------------------------------------------------
@@ -107,8 +107,21 @@ done
if ! type $EASY_INSTALL > /dev/null; then
- # work around for unusual installs
- if [ '!' -e /usr/lib/python2.7/dist-packages/easy_install.py ] && [ '!' -e /usr/local/lib/python2.7/dist-packages/easy_install.py ] && [ '!' -e /usr/pkg/lib/python2.7/dist-packages/easy_install.py ]; then
+ # work around for installs with executable easy_install
+ EASY_INSTALL_FOUND=0
+ MYPYTHONPATH=`python -v </dev/null 2>&1 >/dev/null | sed -n -e '/^# \/.*\/os.py/{ s/.*matches //; s/os.py$//; p}'`
+ for PATHCANDIDATE in \
+ "dist-packages/" \
+ "site-packages/"
+ do
+ if [ -e "${MYPYTHONPATH}/${PATHCANDIDATE}/easy_install.py" ] ; then
+
+ EASY_INSTALL_FOUND=1
+ break
+
+ fi
+ done
+ if [ '!' $EASY_INSTALL_FOUND ]; then
echo "[-] Error: Python setup-tools not found. Run 'sudo apt-get install python-setuptools'."
PREREQ_NOTFOUND=1