Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

tar: listing a member can lose its original name bytes

Open
#383 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@SichenLiang is already working on this.

Since Oct 2, 2026.

  • #384 by @SichenLiang — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
cli

Research direction

Reproduce the issue with the provided Python script and compare tar -t and tar -tv output against GNU tar. Locate the member-name formatting path used by listing mode, then inspect nearby tests or add coverage for invalid bytes, newlines, ESC, and locale-sensitive names. Done means listing preserves distinct names through GNU-compatible quoting without changing the explicitly excluded output modes.

Written by the indexing model from the issue text.

Description

On Linux, tar -t and tar -tv do not quote member names. A newline is written as an actual line break, ESC is sent to the terminal, and invalid bytes are replaced with U+FFFD. Two distinct names can therefore produce the same listing.

The following creates an archive member containing byte ff and compares the raw output with GNU tar 1.35:

LC_ALL=C python3 - <<'PY'
import os, subprocess, tempfile

app = os.path.abspath('target/release/tarapp')
with tempfile.TemporaryDirectory() as d:
    name = b'bad-\xff'
    path = os.fsencode(d) + b'/' + name
    fd = os.open(path, os.O_WRONLY | os.O_CREAT, 0o600)
    os.write(fd, b'x')
    os.close(fd)
    archive = os.path.join(d, 'a.tar')
    subprocess.run(
        [b'/usr/bin/tar', b'-cf', os.fsencode(archive), b'-C', os.fsencode(d), name],
        check=True,
    )
    for label, program in [('GNU', '/usr/bin/tar'), ('uutils', app)]:
        p = subprocess.run([program, '-tf', archive], capture_output=True)
        print(label, p.returncode, repr(p.stdout), repr(p.stderr))
PY

GNU prints b'bad-\\377\n'; uutils prints b'bad-\xef\xbf\xbd\n'. Both exit 0 with empty stderr.

GNU also prints a newline in a name as \n. Under LC_ALL=C, it prints café as caf\303\251; under C.UTF-8, it leaves café unchanged.

This issue is limited to member names in -t and -tv output. Quoting options, verbose create/extract output, verbose link targets, and the owner/group columns are separate work.

Dominant language
Rust
Stars
51
Forks
17
Avg merge
8h 6m
Merged PRs (30d)
31

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from uutils/tar

All issues in uutils/tar

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.