uutils / uutils/coreutils

bug(basenc): when appending a/ to a regular file regardless of the encoding, reports wrong error messages

Open
#12,799 0 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

Hi, uutils mainteners

i want let you known, that appending / to a regular file causes reporting wrong error messages no such file or directory, as our testing confirms
all encoding options have the same issue

relunsec@relunsec:~/software/coreutils/target/debug$ ./basenc --base64url a/
basenc: a/: No such file or directory
relunsec@relunsec:~/software/coreutils/target/debug$ ./basenc --base32 a/
basenc: a/: No such file or directory
relunsec@relunsec:~/software/coreutils/target/debug$ ./basenc --base64 a/
basenc: a/: No such file or directory
relunsec@relunsec:~/software/coreutils/target/debug$ ./basenc --base32hex a/
basenc: a/: No such file or directory
relunsec@relunsec:~/software/coreutils/target/debug$ ./basenc --base16 a/
basenc: a/: No such file or directory
relunsec@relunsec:~/software/coreutils/target/debug$ ./basenc --base2lsbf a/
basenc: a/: No such file or directory
relunsec@relunsec:~/software/coreutils/target/debug$ ./basenc --base2msbf a/
basenc: a/: No such file or directory
relunsec@relunsec:~/software/coreutils/target/debug$ ./basenc --z85 a/
basenc: a/: No such file or directory
relunsec@relunsec:~/software/coreutils/target/debug$ ./basenc --base58 a/
basenc: a/: No such file or directory

while the GNU one correctly errors out

relunsec@relunsec:~/software/coreutils/target/debug$ gnubasenc --base64 a/
gnubasenc: a/: Not a directory
relunsec@relunsec:~/software/coreutils/target/debug$ 

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 listed basenc commands with a regular file followed by a/ and compare their diagnostics with GNU basenc. Trace basenc's input-path handling and error reporting across the encoding options; done means reporting “Not a directory” rather than “No such file or directory” for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.