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

tests: replace Windows-reserved nul.txt fixtures in tail and awk

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

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

@matt-dz がすでに取り組んでいます。

2026年10月23日 から。

  • #685 @matt-dz による — オープン

評価

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

調査の方向性

builtins/tail/tail_test.go と builtins/tests/awk/awk_test.go にある、指定された3つのテストを読みます。NULバイト、オプション、アサーションを維持しながら、それらのfixtureファイルとコマンドオペランドの名前を nul.txt から records.txt などのポータブルな名前に変更します。Windows と Linux または macOS で TestTailZeroTerminatedLines、TestTailZeroTerminatedOffsetMode、TestAwkSingleCharacterRecordSeparator を実行します。各システムですべてのテストが通れば完了です。

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

説明

pre-migration
Describe the bug

Three record-separator tests use nul.txt as a fixture filename. Windows reserves NUL, including names with extensions such as nul.txt, so rshell's confined filesystem access rejects the path before the intended NUL-delimited input can be processed.

Pre-migration work: Fix these fixtures in rshell before migrating the tests into datadog-agent. This is a test portability issue; the failures do not establish a defect in tail/awk record parsing.

Affected tests, still present on rshell main at 7d23f9f1d22cae7f3f581efb03ba02fc1ed4717e:

Steps to reproduce

Run these three tests on Windows. The tail fixtures contain alpha\x00beta\x00gamma\x00; the awk fixture contains alpha\x00beta\x00. Each command opens the fixture using the name nul.txt.

Expected behavior

The tests should open ordinary temporary files and verify their existing record-separator assertions on Windows as well as Linux/macOS.

Actual behavior

The tail tests return exit code 1 and empty stdout rather than the expected beta\x00gamma\x00.

The awk test reports:

awk: fatal: cannot open file `nul.txt' for reading: openat nul.txt: path escapes from parent

The NUL-delimited records are missing from its output; the subsequent comma-delimited command still produces output. The error is the filesystem API rejecting a reserved Windows path, not evidence that the test attempted directory traversal.

Proposed fix and validation

Rename the affected fixtures and command operands to a portable filename such as records.txt. Preserve the NUL bytes, command options, and existing assertions. Validate all three tests on Windows and retain Linux/macOS coverage; no change to filesystem restrictions or command parsing is needed for the fixture fix.

Environment and evidence
主要言語
Go
スター
31
フォーク
3
平均マージ
1日 2時間
マージ済み PR(30日)
13

環境構築

はじめの一歩

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

DataDog/rshell のほかの issue

DataDog/rshell の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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