fix: [Launcher] fix virtualenv loader

This commit is contained in:
Terrtia 2020-09-03 14:38:17 +02:00
parent 4a0613e3c9
commit 55ab603f27
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0
2 changed files with 8 additions and 12 deletions

View file

@ -18,22 +18,20 @@ cd ${AIL_HOME}
if [ -e "${DIR}/AILENV/bin/python" ]; then
ENV_PY="${DIR}/AILENV/bin/python"
export AIL_VENV=${AIL_HOME}/AILENV/
. ./AILENV/bin/activate
elif [ ! -z "$TRAVIS" ]; then
echo "Travis detected"
ENV_PY="~/virtualenv/python3.6/bin/python"
export AIL_VENV="~/virtualenv/python3.6/"
else
echo "Please make sure you have a AIL-framework environment, au revoir"
exit 1
fi
# redis-server is bundled during install
## [ ! -f "`which redis-server`" ] && echo "'redis-server' is not installed/not on PATH. Please fix and run again." && exit 1
export AIL_BIN=${AIL_HOME}/bin/
export AIL_FLASK=${AIL_HOME}/var/www/
export AIL_REDIS=${AIL_HOME}/redis/src/
export AIL_ARDB=${AIL_HOME}/ardb/src/
else
echo "Please make sure you have a AIL-framework environment, au revoir"
exit 1
fi
export PATH=$AIL_VENV/bin:$PATH
export PATH=$AIL_HOME:$PATH

View file

@ -103,13 +103,11 @@ def is_valid_default_yara_rule(yara_rule):
yara_dir = get_yara_rules_default_dir()
filename = os.path.join(yara_dir, yara_rule)
filename = os.path.realpath(filename)
print(yara_dir)
print(filename)
# incorrect filename
if not os.path.commonprefix([filename, yara_dir]) == yara_dir:
print('error: file transversal')
print(yara_dir)
print(filename)
return False
else:
if os.path.isfile(filename):