Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
repl: create history file with mode 0600.#3394
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
lib/internal/repl.js Outdated
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.
you can use an octal literal: 0o0600
Trott commented Oct 16, 2015
LGTM if CI is happy. |
Trott commented Oct 16, 2015
Fixes: #3392 |
Trott commented Oct 16, 2015
Trott commented Oct 16, 2015
XeCycle commented Oct 17, 2015
Tried it on Windows, and the returned stat is 010666. I guess that's because Windows uses a different permission model; do you think it okay to skip this test on Windows? |
rvagg commented Oct 17, 2015
I think so but lets ask @nodejs/platform-windows |
Trott commented Oct 17, 2015
I changed To just this So that it would report the actual value. Result is here. So, Windows is creating the file with mode 0666 rather than 0600. The question is: Is this a bug in the code that creates the file or is it a limitation of running the Node.js REPL on the Windows operating system? |
Trott commented Oct 17, 2015
The code uses |
Trott commented Oct 17, 2015
This comment in the |
XeCycle commented Oct 17, 2015
From docs of CreateFile:
So privacy on the history file relies on the user having a fine ACL in his/her home directory (which appers to be like |
Trott commented Oct 17, 2015
Cool. LGTM if CI passes. |
Trott commented Oct 17, 2015
All test failures are just the unrelated usual suspects and something weird with OS X such that it won't even build or something. In other words: 👍 Hopefully someone else can give it an LGTM too. |
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.
You can use assert.ifError instead of this if block.
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.
I see there are other tests writing if (err) throw err; e.g. test-fs-write. Does the current style explicitly prefer assert.ifError? If not I think this if block is also okay.
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.
No need to use assert here, this is common practice.
Fishrock123 commented Oct 19, 2015
Seems fine to me. |
Trott commented Oct 19, 2015
@Fishrock123 Does that constitute an LGTM? |
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.
Could you make this consistent with the other test? '.node_repl_history'
XeCycle commented Oct 21, 2015
@Fishrock123 file name changed, not rebasing. |
XeCycle commented Nov 3, 2015
Please check this commit. Discovered we have |
Fishrock123 commented Nov 9, 2015
Undefined. |
jasnell commented Apr 22, 2016
What's the status on this one? |
XeCycle commented Apr 22, 2016
Seems like maintainers did not agree on the tests. Anyway there are no conflicts, a rebase is easy, so let me know if you want this landed. |
jasnell commented Apr 22, 2016
@nodejs/collaborators @nodejs/ctc ... does anyone have any further thoughts on this one? |
Fishrock123 commented May 2, 2016
Fishrock123 commented May 2, 2016
ci is green, I can't really make an informative opinion about this though |
silverwind commented May 2, 2016
|
Fishrock123 commented May 2, 2016
Ok, LGTM then |
santigimeno commented May 3, 2016
LGTM |
lib/internal/repl.js Outdated
jasnellMay 3, 2016 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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: Would you mind adding a quick code comment with a quick explanation here. Nothing complicated, just enough for someone scanning through to know why the flag was set to this.
jasnell commented May 3, 2016
Added a couple of comments that I'd like to see addressed before this lands. Otherwise LGTM |
jasnell commented May 3, 2016
What semver-iness would this be? I'm thinking just a patch (because I'd consider this a bug fix) but figured I'd ask. |
Fishrock123 commented May 3, 2016
I don't think it would be major. |
Test code mostly written by Trott nodejs#3392 (comment).
XeCycle commented May 4, 2016
Added, pointing to this PR and issue.
Me too, changed it to the masked version. |
jasnell commented May 4, 2016
jasnell commented May 4, 2016
LGTM if CI is green |
Set the mode bits on the history file to 0o600 instead of leaving it unspecified, which resulted in 0o755 on Unices. Test code mostly written by Trott: #3392 (comment). PR-URL: #3394Fixes: #3392 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: James M Snell <[email protected]>
silverwind commented May 4, 2016
Thanks you! Landed in b72d048. |
Set the mode bits on the history file to 0o600 instead of leaving it unspecified, which resulted in 0o755 on Unices. Test code mostly written by Trott: #3392 (comment). PR-URL: #3394Fixes: #3392 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: James M Snell <[email protected]>
Set the mode bits on the history file to 0o600 instead of leaving it unspecified, which resulted in 0o755 on Unices. Test code mostly written by Trott: #3392 (comment). PR-URL: #3394Fixes: #3392 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: James M Snell <[email protected]>
Set the mode bits on the history file to 0o600 instead of leaving it unspecified, which resulted in 0o755 on Unices. Test code mostly written by Trott: #3392 (comment). PR-URL: #3394Fixes: #3392 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: James M Snell <[email protected]>
Set the mode bits on the history file to 0o600 instead of leaving it unspecified, which resulted in 0o755 on Unices. Test code mostly written by Trott: #3392 (comment). PR-URL: #3394Fixes: #3392 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: James M Snell <[email protected]>
Test code mostly written by Trott
#3392 (comment).