process,tty: allow reading/writing from duplex sockets#23053
Closed
addaleax wants to merge 7 commits intonodejs:masterfrom
Closed
process,tty: allow reading/writing from duplex sockets#23053addaleax wants to merge 7 commits intonodejs:masterfrom
addaleax wants to merge 7 commits intonodejs:masterfrom
Conversation
This reverts commit 91eec00. Refs: nodejs#21654 Refs: nodejs#21203
Since faking TTY input is not otherwise fake-able, we need support in the test runner for it.
Allow reading from stdio streams that are conventionally associated with process output, since this is only convention. This involves disabling the oddness around closing stdio streams. Its purpose is to prevent the file descriptors 0 through 2 from being closed, since doing so can lead to information leaks when new file descriptors are being opened; instead, not doing anything seems like a more reasonable choice. Fixes: nodejs#21203
Make sure that `process.stdin.write()`, and in particular ending the stream, works.
Contributor
|
Is it worth to move the obsolete errors to the Refs: #22100 |
doc/api/errors.md
Outdated
| size. | ||
|
|
||
| <a id="ERR_TTY_WRITABLE_NOT_READABLE"></a> | ||
| ### ERR_TTY_WRITABLE_NOT_READABLE |
Contributor
There was a problem hiding this comment.
Nit: ### -> #### for level consistency)
Member
Author
There was a problem hiding this comment.
Done … this seems like something that our linter could maybe catch as well?
Contributor
There was a problem hiding this comment.
It seems, in this case, it will not be clear for a linter if this is a new level or just a typo.
Member
Author
jasnell
approved these changes
Oct 1, 2018
Member
Author
|
Windows re-build: https://ci.nodejs.org/job/node-test-commit-windows-fanned/21239/ ✔️ |
Member
Author
|
Landed in 17a0cd2...8bf48bf I’ve added this to the 11.0.0 milestone because it reverts a semver-major change that would otherwise be released in that version. |
addaleax
added a commit
that referenced
this pull request
Oct 4, 2018
addaleax
added a commit
that referenced
this pull request
Oct 4, 2018
Since faking TTY input is not otherwise fake-able, we need support in the test runner for it. PR-URL: #23053 Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax
added a commit
that referenced
this pull request
Oct 4, 2018
Allow reading from stdio streams that are conventionally associated with process output, since this is only convention. This involves disabling the oddness around closing stdio streams. Its purpose is to prevent the file descriptors 0 through 2 from being closed, since doing so can lead to information leaks when new file descriptors are being opened; instead, not doing anything seems like a more reasonable choice. Fixes: #21203 PR-URL: #23053 Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax
added a commit
that referenced
this pull request
Oct 4, 2018
Make sure that `process.stdin.write()`, and in particular ending the stream, works. PR-URL: #23053 Reviewed-By: James M Snell <jasnell@gmail.com>
This was referenced Oct 11, 2018
jasnell
pushed a commit
that referenced
this pull request
Oct 17, 2018
jasnell
pushed a commit
that referenced
this pull request
Oct 17, 2018
Since faking TTY input is not otherwise fake-able, we need support in the test runner for it. PR-URL: #23053 Reviewed-By: James M Snell <jasnell@gmail.com>
jasnell
pushed a commit
that referenced
this pull request
Oct 17, 2018
Allow reading from stdio streams that are conventionally associated with process output, since this is only convention. This involves disabling the oddness around closing stdio streams. Its purpose is to prevent the file descriptors 0 through 2 from being closed, since doing so can lead to information leaks when new file descriptors are being opened; instead, not doing anything seems like a more reasonable choice. Fixes: #21203 PR-URL: #23053 Reviewed-By: James M Snell <jasnell@gmail.com>
jasnell
pushed a commit
that referenced
this pull request
Oct 17, 2018
Make sure that `process.stdin.write()`, and in particular ending the stream, works. PR-URL: #23053 Reviewed-By: James M Snell <jasnell@gmail.com>
This was referenced Oct 23, 2018
3 tasks
addaleax
added a commit
to addaleax/node
that referenced
this pull request
Jan 22, 2019
This has been unused since cbc3ef6. Refs: nodejs#23053
3 tasks
BethGriggs
pushed a commit
that referenced
this pull request
Mar 19, 2019
Allow reading from stdio streams that are conventionally associated with process output, since this is only convention. This involves disabling the oddness around closing stdio streams. Its purpose is to prevent the file descriptors 0 through 2 from being closed, since doing so can lead to information leaks when new file descriptors are being opened; instead, not doing anything seems like a more reasonable choice. Fixes: #21203 Backport-PR-URL: #25351 PR-URL: #23053 Reviewed-By: James M Snell <jasnell@gmail.com>
Merged
4 tasks
abhishekumar-tyagi
pushed a commit
to abhishekumar-tyagi/node
that referenced
this pull request
May 5, 2024
Since faking TTY input is not otherwise fake-able, we need support in the test runner for it. PR-URL: nodejs/node#23053 Reviewed-By: James M Snell <jasnell@gmail.com>
abhishekumar-tyagi
pushed a commit
to abhishekumar-tyagi/node
that referenced
this pull request
May 5, 2024
Allow reading from stdio streams that are conventionally associated with process output, since this is only convention. This involves disabling the oddness around closing stdio streams. Its purpose is to prevent the file descriptors 0 through 2 from being closed, since doing so can lead to information leaks when new file descriptors are being opened; instead, not doing anything seems like a more reasonable choice. Fixes: nodejs/node#21203 PR-URL: nodejs/node#23053 Reviewed-By: James M Snell <jasnell@gmail.com>
abhishekumar-tyagi
pushed a commit
to abhishekumar-tyagi/node
that referenced
this pull request
May 5, 2024
Make sure that `process.stdin.write()`, and in particular ending the stream, works. PR-URL: nodejs/node#23053 Reviewed-By: James M Snell <jasnell@gmail.com>
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.
As of libuv 1.23.1, the direction of OS-level streams is automatically detected, meaning that reading from
stdout/stderrand writing toprocess.stdinare working again. Making this work completely (i.e. no error when the stream ends) requires some additional fixups to our stdio code.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes