From 341a22ad90b85605d2567f554fb9f5ff29d5be3f Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Thu, 7 Jun 2018 18:49:01 +1200 Subject: [PATCH] Skip ELF-only sec-hard checks on non-ELF binaries --- qa/zcash/full_test_suite.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qa/zcash/full_test_suite.py b/qa/zcash/full_test_suite.py index 362876f61..0e8605cc3 100755 --- a/qa/zcash/full_test_suite.py +++ b/qa/zcash/full_test_suite.py @@ -63,6 +63,13 @@ def check_security_hardening(): # PIE, RELRO, Canary, and NX are tested by make check-security. ret &= subprocess.call(['make', '-C', repofile('src'), 'check-security']) == 0 + # The remaining checks are only for ELF binaries + # Assume that if zcashd is an ELF binary, they all are + with open(repofile('src/zcashd'), 'rb') as f: + magic = f.read(4) + if not magic.startswith(b'\x7fELF'): + return ret + ret &= test_rpath_runpath('src/zcashd') ret &= test_rpath_runpath('src/zcash-cli') ret &= test_rpath_runpath('src/zcash-gtest')