You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
-o NUL fails on Windows: CreateFile opens devices with O_TRUNC #208
On Windows, -o NUL (and -stats NUL, -sarif NUL) fails with open NUL: Incorrect function. and exit 1, while -o /dev/null works on Linux and macOS. The results-file code opens non-regular targets with O_TRUNC, which the Windows NUL device rejects.
os.Stat("NUL") reports a non-regular file on Windows, but opening it with O_TRUNC returns ERROR_INVALID_FUNCTION.
Impact
Windows users can't discard results with -o NUL, for example to keep only -stats or -sarif. Low severity: a workaround is to omit -o.
Steps to reproduce
On Windows: subenum -simulate -w examples/sample_wordlist.txt -o NUL example.com
Output: Error: creating output file: open NUL: Incorrect function. and exit code 1.
Suggested fix
Drop O_TRUNC for non-regular targets (truncating a device or pipe is meaningless), or retry without it when it fails. Then remove the Windows skip in TestCreateFileWritesNonRegularTargetDirectly (internal/output/lifecycle_test.go).
Acceptance criteria
-o NUL works on Windows
TestCreateFileWritesNonRegularTargetDirectly runs on Windows (CI's test-os job covers it)
Activity
fix(output): open device and pipe targets without O_TRUNC (#208) (#209)
docs(changelog): unreleased fixes since v0.10.0 and version links (#231)