aboutsummaryrefslogtreecommitdiffstats
path: root/anteater/src
diff options
context:
space:
mode:
Diffstat (limited to 'anteater/src')
-rw-r--r--anteater/src/get_lists.py3
-rw-r--r--anteater/src/patch_scan.py3
-rw-r--r--anteater/src/project_scan.py5
3 files changed, 6 insertions, 5 deletions
diff --git a/anteater/src/get_lists.py b/anteater/src/get_lists.py
index ff63442..4eb1d3f 100644
--- a/anteater/src/get_lists.py
+++ b/anteater/src/get_lists.py
@@ -86,9 +86,8 @@ class GetLists(object):
def binary_hash(self, project, patch_file):
self.load_project_exception_file(ml.get('project_exceptions'), project)
- file_name = os.path.basename(patch_file)
try:
- binary_hash = (ml['binaries'][project][file_name])
+ binary_hash = (ml['binaries'][project][patch_file])
return binary_hash
except KeyError:
binary_hash = 'null'
diff --git a/anteater/src/patch_scan.py b/anteater/src/patch_scan.py
index 3097d00..3d29c65 100644
--- a/anteater/src/patch_scan.py
+++ b/anteater/src/patch_scan.py
@@ -84,7 +84,8 @@ def scan_patch(project, patch_file, binary_list, file_audit_list,
global failure
if is_binary(patch_file):
hashlist = get_lists.GetLists()
- binary_hash = hashlist.binary_hash(project, patch_file)
+ split_path = patch_file.split(project + '/', 1)[-1]
+ binary_hash = hashlist.binary_hash(project, split_path)
if not binary_list.search(patch_file):
with open(patch_file, 'rb') as afile:
buf = afile.read()
diff --git a/anteater/src/project_scan.py b/anteater/src/project_scan.py
index 3a04a83..b80b73f 100644
--- a/anteater/src/project_scan.py
+++ b/anteater/src/project_scan.py
@@ -93,9 +93,10 @@ def scan_file(project_dir, project, binary_list, file_audit_list,
# Check if Binary is whitelisted
hashlist = get_lists.GetLists()
- binary_hash = hashlist.binary_hash(project, full_path)
+ split_path = full_path.split(project + '/', 1)[-1]
+ binary_hash = hashlist.binary_hash(project, split_path)
- if is_binary(full_path) and not binary_list.search(full_path):
+ if is_binary(full_path):
with open(full_path, 'rb') as afile:
buf = afile.read()
hasher.update(buf)