chg: [yara trackers] add debug

pull/534/head v3.1.1
Terrtia 2020-08-27 09:51:05 +02:00
parent 0d06f633e2
commit 0872fb23d3
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
1 changed files with 4 additions and 0 deletions

View File

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