uutils / uutils/coreutils

Lossy conversion is harmful

Open
#10,943 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The lossy conversions used by many programs is (almost?) always incorrect.

One of the more severe misbehaviors can be seen with the following users:

$ useradd --badname $(printf 'test\xC2user')
$ useradd --badname $(printf 'test\xEF\xBF\xBDuser')
$ id $(printf 'test\xC2user')
uid=1001(test�user) gid=1001(test�user) groups=1001(test�user)
$ id $(printf 'test\xEF\xBF\xBDuser')
uid=1002(test�user) gid=1002(test�user) groups=1002(test�user)

Anytime that uutils converts a UID to a username it will print the incorrect user which can be seen with id:

$ uu-id $(uu-id -un 1001)
uid=1002(test�user) gid=1002(test�user) groups=1002(test�user)

GNU returns the correct user:

$ id $(id -un 1001)
uid=1001(test�user) gid=1001(test�user) groups=1001(test�user)

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 by reproducing the issue with the shown useradd, id, and uu-id commands, then trace the UID-to-username lookup used by uu-id and id. Confirm how invalid or lossy name conversion causes distinct usernames to collide. Done means the uutils commands return the same distinct user as GNU coreutils for the demonstrated UIDs.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.