cmds.secrets: Fix rewrite() of long member names #135
1 changed files with 6 additions and 0 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue