diff options
author | Patrick Gartung <gartung@fnal.gov> | 2020-03-04 17:15:09 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-04 17:15:09 -0600 |
commit | 3ea0e91533b0dbf68be56fd6759bfc4331651404 (patch) | |
tree | 4d2e058ac097d8d4c815b9a5d6d7777d6905f776 /lib | |
parent | 8eda1db50ff67bc370507da25047eb8e848de40b (diff) | |
download | spack-3ea0e91533b0dbf68be56fd6759bfc4331651404.tar.gz spack-3ea0e91533b0dbf68be56fd6759bfc4331651404.tar.bz2 spack-3ea0e91533b0dbf68be56fd6759bfc4331651404.tar.xz spack-3ea0e91533b0dbf68be56fd6759bfc4331651404.zip |
use os.sep instead of null byte to pad replacement paths in binaries (#15338)
* use os.sep instead of null byte to pad replacement paths in binaries
* Prefix the pading os.sep's
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/relocate.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/spack/spack/relocate.py b/lib/spack/spack/relocate.py index fb4ff18fae..a6aea329e1 100644 --- a/lib/spack/spack/relocate.py +++ b/lib/spack/spack/relocate.py @@ -412,7 +412,8 @@ def replace_prefix_bin(path_name, old_dir, new_dir): if padding < 0: return data return match.group().replace(old_dir.encode('utf-8'), - new_dir.encode('utf-8')) + b'\0' * padding + os.sep.encode('utf-8') * padding + + new_dir.encode('utf-8')) with open(path_name, 'rb+') as f: data = f.read() |