-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
process,tty: allow reading/writing from duplex sockets #23053
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.
Is it worth to move the obsolete errors to the Refs: #22100 |
doc/api/errors.md
Outdated
@@ -2065,6 +2078,13 @@ instance.setEncoding('utf8'); | |||
An attempt has been made to create a string larger than the maximum allowed | |||
size. | |||
|
|||
<a id="ERR_TTY_WRITABLE_NOT_READABLE"></a> | |||
### ERR_TTY_WRITABLE_NOT_READABLE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: ###
-> ####
for level consistency)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done … this seems like something that our linter could maybe catch as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems, in this case, it will not be clear for a linter if this is a new level or just a typo.
Windows re-build: https://ci.nodejs.org/job/node-test-commit-windows-fanned/21239/ ✔️ |
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. |
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>
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>
Make sure that `process.stdin.write()`, and in particular ending the stream, works. PR-URL: #23053 Reviewed-By: James M Snell <jasnell@gmail.com>
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>
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>
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 has been unused since cbc3ef6. Refs: nodejs#23053
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>
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>
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>
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>
As of libuv 1.23.1, the direction of OS-level streams is automatically detected, meaning that reading from
stdout
/stderr
and writing toprocess.stdin
are 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