cmds.secrets: Fix rewrite() of long member names #135

Merged
Jan Lindemann merged 1 commit from jan/feature/20261003-cmds-secrets-fix-rewrite-of-long-member-names into master 2026-10-03 12:41:59 +02:00 AGit
Owner

cmds.secrets: Fix rewrite() of long member names

rewrite() renames the members of a tar blob, but the TarInfo objects carried over from the input still hold the pax path supplement that was recorded for the original name. Re-serialization (tf_out.addfile()) uses the pax supplement with higher precedence than what's in the base header's name filed, so for member names exceeding the 100 character ustar limit the rewrite silently has no effect and the original name is written back.

Drop the stale path supplement after renaming a member. tf_out.addfile() then builds a rewritten, up-to-date supplement from the name field if it needs one.

#### cmds.secrets: Fix rewrite() of long member names `rewrite()` renames the members of a tar blob, but the TarInfo objects carried over from the input still hold the pax `path` supplement that was recorded for the original name. Re-serialization (`tf_out.addfile()`) uses the pax supplement with higher precedence than what's in the base header's name filed, so for member names exceeding the 100 character ustar limit the rewrite silently has no effect and the original name is written back. Drop the stale `path` supplement after renaming a member. `tf_out.addfile()` then builds a rewritten, up-to-date supplement from the name field if it needs one.
cmds.secrets: Fix rewrite() of long member names
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 5m21s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 5m26s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 5m27s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 5m3s
CI / Packaging test (push) Successful in 0s
939eb09c0f
rewrite() renames the members of a tar blob, but the TarInfo objects
carried over from the input still hold the pax "path" supplement that was
recorded for the original name. Re-serialization (tf_out.addfile()) uses
the pax supplement with higher precedence than what's in the base header's
name filed, so for member names exceeding the 100 character ustar limit the
rewrite silently has no effect and the original name is written back.

Drop the stale "path" supplement after renaming a member. tf_out.addfile()
then builds a rewritten, up-to-date supplement from the name field if it
needs one.

Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.0.0
Signed-off-by: Jan Lindemann <jan@janware.com>
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-10-03 12:31:09 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
janware/jw-pkg!135
No description provided.