GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — repl: create history file with mode 0600. by XeCycle · Pull Request #3394 · nodejs/node

Conversation

@XeCycle

@XeCycle XeCycle commented Oct 16, 2015

Copy link
Copy Markdown
Contributor

Test code mostly written by Trott
#3392 (comment).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@XeCycle
XeCycle force-pushed the repl-hist-perm branch from 3d57ee8 to 9ec50f0 Compare October 16, 2015 08:18
targos
targos reviewed Oct 16, 2015
View reviewed changes
Comment thread lib/internal/repl.js Outdated

@targos targos Oct 16, 2015

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@XeCycle
XeCycle force-pushed the repl-hist-perm branch from 9ec50f0 to 4e6c697 Compare October 16, 2015 08:29
@ChALkeR ChALkeR added the repl Issues and PRs related to the REPL subsystem. label Oct 16, 2015
@Trott

Trott commented Oct 16, 2015

Copy link
Copy Markdown
Member

LGTM if CI is happy.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Oct 16, 2015

Copy link
Copy Markdown
Member

Fixes: #3392

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Oct 16, 2015

Copy link
Copy Markdown
Member

CI: https://ci.nodejs.org/job/node-test-commit/859/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Oct 16, 2015

Copy link
Copy Markdown
Member

Test fails on Windows: https://ci.nodejs.org/job/node-test-binary-windows/14/RUN_SUBSET=0,VS_VERSION=vs2015,label=win10/tapTestReport/test.tap-155/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@XeCycle

XeCycle commented Oct 17, 2015

Copy link
Copy Markdown
Contributor Author

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rvagg

rvagg commented Oct 17, 2015

Copy link
Copy Markdown
Member

I think so but lets ask @nodejs/platform-windows

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Oct 17, 2015

Copy link
Copy Markdown
Member

I changed

  assert.strictEqual(mode, '0600', 'REPL history file should be mode 0600');

To just this

  assert.strictEqual(mode, '0600');

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Oct 17, 2015

Copy link
Copy Markdown
Member

The code uses fs.open() to set the mode on file creation, so I guess if there's stuff that does not completely work there, a Windows libuv person would know the deal?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Oct 17, 2015

Copy link
Copy Markdown
Member

This comment in the libuv source would seem to be more-or-less a smoking gun. I think you can just check common.isWindows() at the top of the test, and if it is Windows, skip the test. You can emulate other tests like this from test-process-remove-all-signal-listeners:

if (common.isWindows) {
  console.log('1..0 # Skipped: Win32 doesn\'t have signals, just a kind of ' +
              'emulation, insufficient for this test to apply.');
  return;
}
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@XeCycle

XeCycle commented Oct 17, 2015

Copy link
Copy Markdown
Contributor Author

From docs of CreateFile:

  • The access control lists (ACL) in the default security descriptor for a file or directory are inherited from its parent directory.

So privacy on the history file relies on the user having a fine ACL in his/her home directory (which appers to be like C:\Users\username).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Oct 17, 2015

Copy link
Copy Markdown
Member

Cool. LGTM if CI passes.

CI: https://ci.nodejs.org/job/node-test-commit/865/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Oct 17, 2015

Copy link
Copy Markdown
Member

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

thefourtheye
thefourtheye reviewed Oct 17, 2015
View reviewed changes
Comment thread test/parallel/test-repl-history-perm.js Outdated

@thefourtheye thefourtheye Oct 17, 2015

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@XeCycle XeCycle Oct 17, 2015

Copy link
Copy Markdown
Contributor Author

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@Fishrock123 Fishrock123 Oct 19, 2015

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Fishrock123

Fishrock123 commented Oct 19, 2015

Copy link
Copy Markdown
Contributor

Seems fine to me.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Oct 19, 2015

Copy link
Copy Markdown
Member

@Fishrock123 Does that constitute an LGTM?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Fishrock123
Fishrock123 reviewed Oct 20, 2015
View reviewed changes
Comment thread test/parallel/test-repl-history-perm.js Outdated

@Fishrock123 Fishrock123 Oct 20, 2015

Copy link
Copy Markdown
Contributor

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'

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@XeCycle

XeCycle commented Oct 21, 2015

Copy link
Copy Markdown
Contributor Author

@Fishrock123 file name changed, not rebasing.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@XeCycle

XeCycle commented Nov 3, 2015

Copy link
Copy Markdown
Contributor Author

Please check this commit. Discovered we have -i/--interactive, so tried testing with that, but it fails because of another check here and here. Is it intended that a forced interactive session without terminal does not create a history file?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fishrock123

Fishrock123 commented Nov 9, 2015

Copy link
Copy Markdown
Contributor

Discovered we have -i/--interactive, so tried testing with that, but it fails because of another check here and here. Is it intended that a forced interactive session without terminal does not create a history file?

Undefined. -i/--interactive should act just like the regular repl as much as possible though imo.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott
Trott force-pushed the master branch from 1e896a6 to 082cc8d Compare December 27, 2015 02:00
@jasnell

jasnell commented Apr 22, 2016

Copy link
Copy Markdown
Member

What's the status on this one?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell added the stalled Issues and PRs manually marked as stalled and scheduled for automatic closure. label Apr 22, 2016
@XeCycle

XeCycle commented Apr 22, 2016

Copy link
Copy Markdown
Contributor Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Apr 22, 2016

Copy link
Copy Markdown
Member

@nodejs/collaborators @nodejs/ctc ... does anyone have any further thoughts on this one?
@XeCycle ... if you'd like to rebase I'll see if I can get an updated review.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@estliberitas
estliberitas force-pushed the master branch from 7da4fd4 to c7066fb Compare April 26, 2016 05:22
@Fishrock123

Fishrock123 commented May 2, 2016

Copy link
Copy Markdown
Contributor

ci: https://ci.nodejs.org/job/node-test-pull-request/2463/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fishrock123

Fishrock123 commented May 2, 2016

Copy link
Copy Markdown
Contributor

ci is green, I can't really make an informative opinion about this though

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind

silverwind commented May 2, 2016

Copy link
Copy Markdown
Contributor

600 is the right mode for history files, it protects the content from other users in case the home directory is readable. The test seems a bit overly complicated, but overall LGTM.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fishrock123

Fishrock123 commented May 2, 2016

Copy link
Copy Markdown
Contributor

Ok, LGTM then

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@santigimeno

santigimeno commented May 3, 2016

Copy link
Copy Markdown
Member

LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jasnell
jasnell reviewed May 3, 2016
View reviewed changes
Comment thread lib/internal/repl.js Outdated

@jasnell jasnell May 3, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jasnell

jasnell commented May 3, 2016

Copy link
Copy Markdown
Member

Added a couple of comments that I'd like to see addressed before this lands. Otherwise LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell removed the stalled Issues and PRs manually marked as stalled and scheduled for automatic closure. label May 3, 2016
@jasnell

jasnell commented May 3, 2016

Copy link
Copy Markdown
Member

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fishrock123

Fishrock123 commented May 3, 2016

Copy link
Copy Markdown
Contributor

I don't think it would be major.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@XeCycle
repl: create history file with mode 0600
80612f3
Test code mostly written by Trott
nodejs#3392 (comment).
@XeCycle
XeCycle force-pushed the repl-hist-perm branch from ae592ff to 80612f3 Compare May 4, 2016 01:09
@XeCycle

XeCycle commented May 4, 2016

Copy link
Copy Markdown
Contributor Author

@jasnell

Would you mind adding a quick code comment with a quick explanation here

Added, pointing to this PR and issue.

Personally I prefer the masked version

Me too, changed it to the masked version.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented May 4, 2016

Copy link
Copy Markdown
Member

CI: https://ci.nodejs.org/job/node-test-pull-request/2491/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented May 4, 2016

Copy link
Copy Markdown
Member

LGTM if CI is green

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

silverwind pushed a commit that referenced this pull request May 4, 2016
@XeCycle @silverwind
repl: create history file with mode 0600
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: #3394
Fixes: #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

silverwind commented May 4, 2016

Copy link
Copy Markdown
Contributor

Thanks you! Landed in b72d048.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind silverwind closed this May 4, 2016
@silverwind silverwind added the lts-watch-v4.x label May 4, 2016
evanlucas pushed a commit that referenced this pull request May 17, 2016
@XeCycle @evanlucas
repl: create history file with mode 0600
6353579
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: #3394
Fixes: #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]>
@evanlucas evanlucas mentioned this pull request May 17, 2016
2016-05-17, Version 6.2.0 (Stable) #6810
Merged
@MylesBorins MylesBorins added land-on-v4.x and removed lts-watch-v4.x labels Jun 1, 2016
MylesBorins pushed a commit that referenced this pull request Jun 1, 2016
@XeCycle Myles Borins
repl: create history file with mode 0600
e84a29c
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: #3394
Fixes: #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]>
MylesBorins pushed a commit that referenced this pull request Jun 23, 2016
@XeCycle Myles Borins
repl: create history file with mode 0600
4b57959
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: #3394
Fixes: #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]>
MylesBorins pushed a commit that referenced this pull request Jun 24, 2016
@XeCycle Myles Borins
repl: create history file with mode 0600
4c1eb5b
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: #3394
Fixes: #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]>
@MylesBorins MylesBorins mentioned this pull request Jun 24, 2016
v4.4.7 proposal #7395
Merged
@github-actions github-actions Bot mentioned this pull request Apr 24, 2024
Adding VersionStream for nodejs-22 wolfi-dev/os#17646
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

repl Issues and PRs related to the REPL subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

11 participants

@XeCycle @Trott @rvagg @Fishrock123 @jasnell @silverwind @santigimeno @thefourtheye @targos @ChALkeR @MylesBorins
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.