uutils / uutils/coreutils

mktemp dot-dot file prefix is silently dropped

Open Beginner friendly
#12,312 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

U - mktemp
Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

Using a template with a .. prefix creates a file without the dots:

./target/debug/coreutils mktemp /tmp/..XXXXXX
/tmp/X7ANMW

Expected behavior (matching GNU mktemp):

mktemp /tmp/..XXXXXX
/tmp/..X7ANMW

Path::file_name() returns None for paths ending in .. since it is a special path component, causing the prefix to fall back to an empty string, dropping the dots entirely.

Contributor guide

Open the contributing guide

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.

Research direction

Start at the mktemp implementation and trace how the template prefix is derived when Path::file_name() returns None for a .. component. Reproduce the issue with /tmp/..XXXXXX, then verify that the generated path preserves both dots and matches GNU mktemp behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.