diff --git a/src/python/jw/pkg/cmds/secrets/lib/tar.py b/src/python/jw/pkg/cmds/secrets/lib/tar.py index aeca422c..80009148 100644 --- a/src/python/jw/pkg/cmds/secrets/lib/tar.py +++ b/src/python/jw/pkg/cmds/secrets/lib/tar.py @@ -40,6 +40,12 @@ def rewrite(blob: bytes, rewrite_filter: Callable[[str], str]) -> bytes: new_name = rewrite_filter(info.name) log(DEBUG, f'Rewriting {info.name} -> {new_name}') info.name = new_name + # -- A pax "path" supplement from the input would override + # the rewritten name on re-serialization + info.pax_headers = { + k: v + for k, v in info.pax_headers.items() if k != 'path' + } buf = tf_in.extractfile(info) tf_out.addfile(info, buf) return ret.getvalue()