From 1f772ea0965862dffd3c42a4bbd53c1eda33a738 Mon Sep 17 00:00:00 2001 From: sansna <1185280650@qq.com> Date: Thu, 14 Oct 2021 09:23:59 +0800 Subject: [PATCH] @Wentao[master]: fix CentOS 7 cannot write permission over libnssfix_XXXX.so problem - sansna --- staticx/hooks/glibc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/staticx/hooks/glibc.py b/staticx/hooks/glibc.py index 0778523..a207ce2 100644 --- a/staticx/hooks/glibc.py +++ b/staticx/hooks/glibc.py @@ -3,6 +3,7 @@ from ..elf import open_elf, get_shobj_deps, patch_elf from elftools.elf.gnuversions import GNUVerNeedSection import logging +import os LIBNSSFIX = 'libnssfix.so' @@ -13,6 +14,8 @@ def process_glibc_prog(sx): try: nssfix = copy_asset_to_tempfile(LIBNSSFIX, debug=sx.debug, prefix='libnssfix-', suffix='.so') + umask=os.umask(0o755) + os.chmod(nssfix.name, 0o755&~umask) except KeyError: raise InternalError("GLIBC binary detected but libnssfix.so not available")