From e3a5ac29454e09bd8f2d91ce630049e697f72ea9 Mon Sep 17 00:00:00 2001 From: Takuya ASADA Date: Tue, 9 Apr 2019 20:49:41 +0900 Subject: [PATCH] reloc: run fix_sharedlib() only on application/x-sharedlib and application/x-pie-executable We need to prevent to run fix_sharedlib() on non-ELF files. Fixes #4415 Signed-off-by: Takuya ASADA Message-Id: <20190409114941.28276-1-syuu@scylladb.com> --- scripts/create-relocatable-package-python3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/create-relocatable-package-python3.py b/scripts/create-relocatable-package-python3.py index d4a2f047d0..0eac08afba 100755 --- a/scripts/create-relocatable-package-python3.py +++ b/scripts/create-relocatable-package-python3.py @@ -157,7 +157,7 @@ def copy_file_to_python_env(ar, f): ar.add(os.path.realpath(f), arcname=libfile) else: m = magic.detect_from_filename(f) - if m and m.mime_type.startswith('application/'): + if m and (m.mime_type.startswith('application/x-sharedlib') or m.mime_type.startswith('application/x-pie-executable')): fix_sharedlib(ar, f, libfile) else: # in case this is a directory that is listed, we don't want to include everything that is in that directory