dircolors: directory operand exits 2 with a custom message, GNU prints 'read error: Is a directory' and exits 1

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

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

@emirmrkaljevic がすでに取り組んでいます。

2026年11月14日 から。

  • #16471 @emirmrkaljevic による — オープン

評価

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

調査の方向性

バグは、uutils の dircolors バイナリがデータベースオペランドとして渡されたディレクトリをどう扱うかにあります。このバイナリは expected file, got directory 'dd' を表示して終了コード 2 で終了します。そのメッセージと終了コードがどこで生成されているかを見つけ、GNU の read error: Is a directory、終了ステータス 1 に合わせて変更してください。dircolors -b <dir> が GNU 形式のメッセージを表示し、echo $? が 1 を返せば完了です。

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

説明

U - dircolors

When the database operand is a directory, uutils dircolors uses its own message and exits with 2. GNU dircolors 9.12 prints a read error and exits with 1.

$ mkdir dd
$ dircolors -b dd      # GNU 9.12
dircolors: dd: read error: Is a directory
$ echo $?
1
$ coreutils dircolors -b dd    # uutils main
dircolors: expected file, got directory 'dd'
$ echo $?
2

Scripts that check for exit status 1 on a bad database file see a different code. Found with behave, a black-box differential testing tool I'm building, while running a dircolors spec recorded from GNU 9.12.

主要言語
Rust
スター
24.4k
フォーク
2.2k
平均マージ
3日 6時間
マージ済み PR(30日)
434

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

uutils/coreutils のほかの issue

uutils/coreutils の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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