chg: [yara trackers] add debug

This commit is contained in:
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

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):