mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 08:38:28 +00:00
fix: [Launcher] fix virtualenv loader
This commit is contained in:
parent
4a0613e3c9
commit
55ab603f27
2 changed files with 8 additions and 12 deletions
|
@ -18,23 +18,21 @@ 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/"
|
||||
|
||||
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
|
||||
|
||||
# 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/
|
||||
|
||||
export PATH=$AIL_VENV/bin:$PATH
|
||||
export PATH=$AIL_HOME:$PATH
|
||||
export PATH=$AIL_REDIS:$PATH
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue