🐛 powershell: write stderr read error to the stderr field#8650
Open
tas50 wants to merge 1 commit into
Open
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Contributor
92114e7 to
29e5ae5
Compare
The stderr-read error branch assigned the error to c.Stdout, clobbering the stdout value populated just above and leaving c.Stderr unset. Assign it to c.Stderr instead. This also affects auditpol/secpol, which build on the powershell resource. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015U1ocAxfcBhVYi3f9JnyZZ
29e5ae5 to
8ccea2a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
In
powershell.go, the branch that handles a failedio.ReadAll(x.Stderr)assigned the error toc.Stdoutinstead ofc.Stderr:This is a copy-paste slip from the stdout block above it. When reading stderr fails, it clobbers the stdout value that was just populated correctly and leaves
c.Stderrin its zero/unset state — sopowershell { stdout, stderr }reports a bogus error on.stdoutwhile.stderris silently never set.The
powershellresource underliesauditpolandsecpol, so those inherit the corruption on this error path.Fix
Assign the stderr read error to
c.Stderr.🤖 Generated with Claude Code
https://claude.ai/code/session_015U1ocAxfcBhVYi3f9JnyZZ
Generated by Claude Code