Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Program panic on non-UTF-8 env vars

オープン 初心者向け
#346 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust
領域
backend

調査の方向性

src/shadow-core/src/hardening.rs、src/uu/login/src/login.rs、src/uu/newgrp/src/newgrp.rs に記載された std::env::vars() の4つの呼び出し箇所を読み、Rustの環境変数イテレーターが非UTF-8値をどう扱うかを確認してください。無関係な環境変数に無効なUTF-8が含まれている場合に、各呼び出しがパニックを避ける方法を特定してください。4つすべての箇所で、そのような変数をパニックせずに処理できれば完了です。issueでは実行するテストは指定されていません。

索引モデルが issue の本文から書いたものです。

説明

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():

https://github.com/uutils/shadow/blob/2e1032a2eef886308ae6c75133ec358637d415c3/src/shadow-core/src/hardening.rs#L102

https://github.com/uutils/shadow/blob/2e1032a2eef886308ae6c75133ec358637d415c3/src/shadow-core/src/hardening.rs#L176

https://github.com/uutils/shadow/blob/2e1032a2eef886308ae6c75133ec358637d415c3/src/uu/login/src/login.rs#L393

https://github.com/uutils/shadow/blob/2e1032a2eef886308ae6c75133ec358637d415c3/src/uu/newgrp/src/newgrp.rs#L186

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.

主要言語
Rust
スター
17
フォーク
10
平均マージ
14時間 13分
マージ済み PR(30日)
14

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

uutils/shadow のほかの issue

uutils/shadow の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。