Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open Beginner friendly
#676 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
testing

Research direction

Read the three named tests in builtins/tail/tail_test.go and builtins/tests/awk/awk_test.go. Rename their fixture files and command operands from nul.txt to a portable name such as records.txt, preserving the NUL bytes, options, and assertions. Run TestTailZeroTerminatedLines, TestTailZeroTerminatedOffsetMode, and TestAwkSingleCharacterRecordSeparator on Windows and Linux or macOS; done means all three pass on each.

Written by the indexing model from the issue text.

Description

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
Dominant language
Go
Stars
31
Forks
3
Avg merge
1d 18h
Merged PRs (30d)
12

Getting set up

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.

More from DataDog/rshell

All issues in DataDog/rshell

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.