Program panic on non-UTF-8 env vars
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Read the four std::env::vars() call sites listed in src/shadow-core/src/hardening.rs, src/uu/login/src/login.rs, and src/uu/newgrp/src/newgrp.rs, then check Rust’s environment iterator behavior for non-UTF-8 values. Determine how each call can avoid panicking when unrelated environment variables are invalid UTF-8. Done means all four paths handle such variables without a panic; the issue does not name tests to run.
Written by the indexing model from the issue text.
Description
I have not tested this, but from inspecting the source code, I think that some user-facing code in this repo will panic when faced with an environment variable that isn't valid UTF-8, regardless of whether the program actually needs those environment variables or not.
There are four places in the codebase that call std::env::vars():
As per the documentation, the iterator returned by vars() will panic when it encounters an environment variable that isn't valid UTF-8. This seems undesirable, since it's common for there to be irrelevant env vars hanging around when executing any program.
- Dominant language
- Rust
- Stars
- 17
- Forks
- 10
- Avg merge
- 11h 22m
- Merged PRs (30d)
- 13
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from uutils/shadow
-
usermod: -m/--move-home is not implementedPossibly taken @jayhemnani9910 claimed this today. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
usermod: -g does not move home directory files to the new primary groupPossibly taken @jayhemnani9910 claimed this today. Open
Difficulty 4/5 1-2 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
useradd: -U ignored when USERGROUPS_ENAB is no, accepted with -gPossibly taken @jayhemnani9910 claimed this 1 day ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
useradd, groupadd: system IDs allocated from the bottom of the rangePossibly taken @jayhemnani9910 claimed this 1 day ago. Open
Difficulty 4/5 1-2 days Newbie friendliness 30/100
Maintainers usually reply within 1 day
-
Dependency DashboardOpen
Difficulty 3/5 1-2 days Newbie friendliness 20/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
farion1231/cc-switch#8829 ·
Maintainers usually reply within 1 day
-
bug ci good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
longbridge/gpui-kit#3677 ·
Maintainers usually reply within 1 day
-
E-pr-welcome
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
seanmonstar/reqwest#3121 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
ilya-zlobintsev/LACT#1235 ·
Maintainers usually reply within 1 day