Skip to content
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

fs: fix chown abort #38004

Closed
wants to merge 5 commits into from
Closed

Conversation

RaisinTen
Copy link
Contributor

This syncs the type assertion introduced in the referenced PR in the C++
side. Since chown, lchown, and fchown can accept -1 as a value for uid
and gid, we should also accept signed integers from the JS side.

Fixes: #37995
Refs: #31694

This syncs the type assertion introduced in the referenced PR in the C++
side. Since chown, lchown, and fchown can accept -1 as a value for uid
and gid, we should also accept signed integers from the JS side.

Fixes: nodejs#37995
Refs: nodejs#31694
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels Mar 31, 2021
@@ -8,6 +8,9 @@ const kReadFileBufferLength = 512 * 1024;
const kReadFileUnknownBufferLength = 64 * 1024;
const kWriteFileMaxChunkSize = 512 * 1024;

// 2 ** 32 - 1
const kMaxUserId = 4294967295;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this value? Is this documented somewhere? Could you add a comment explaining where does it come from please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually pasted it from:

node/lib/fs.js

Lines 139 to 140 in 82bc5c3

// 2 ** 32 - 1
const kMaxUserId = 4294967295;

since I could not require it because of a circular dependency.
Should we move this (and possibly other k* constants) into lib/internal/fs/utils.js and require them from there?

@benjamingr
Copy link
Member

Nice, though looks like #37997 was opened already?

@ycjcl868
Copy link
Contributor

ycjcl868 commented Apr 1, 2021

CI broken

@RaisinTen
Copy link
Contributor Author

Nice, though looks like #37997 was opened already?

@benjamingr I opened this as it has a different approach of fixing the issue. Also, #37997 (comment).

@nodejs-github-bot
Copy link
Collaborator

@RaisinTen
Copy link
Contributor Author

CI broken

@ycjcl868 The Github Actions CI seems to be fixed now. Started the Jenkins CI run.

@RaisinTen RaisinTen added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 2, 2021
@Trott
Copy link
Member

Trott commented Apr 3, 2021

Landed in e9ed113

@Trott Trott closed this Apr 3, 2021
Trott pushed a commit that referenced this pull request Apr 3, 2021
This syncs the type assertion introduced in the referenced PR in the C++
side. Since chown, lchown, and fchown can accept -1 as a value for uid
and gid, we should also accept signed integers from the JS side.

Fixes: #37995
Refs: #31694

PR-URL: #38004
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@RaisinTen RaisinTen deleted the fs/fix-chown-abort branch April 3, 2021 14:35
RaisinTen added a commit to RaisinTen/node that referenced this pull request Apr 3, 2021
MylesBorins pushed a commit that referenced this pull request Apr 4, 2021
This syncs the type assertion introduced in the referenced PR in the C++
side. Since chown, lchown, and fchown can accept -1 as a value for uid
and gid, we should also accept signed integers from the JS side.

Fixes: #37995
Refs: #31694

PR-URL: #38004
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Apr 4, 2021
MylesBorins pushed a commit that referenced this pull request Apr 5, 2021
This syncs the type assertion introduced in the referenced PR in the C++
side. Since chown, lchown, and fchown can accept -1 as a value for uid
and gid, we should also accept signed integers from the JS side.

Fixes: #37995
Refs: #31694

PR-URL: #38004
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
jasnell pushed a commit that referenced this pull request Apr 6, 2021
Refs: #38004 (comment)

PR-URL: #38061
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request May 1, 2021
This syncs the type assertion introduced in the referenced PR in the C++
side. Since chown, lchown, and fchown can accept -1 as a value for uid
and gid, we should also accept signed integers from the JS side.

Fixes: #37995
Refs: #31694

PR-URL: #38004
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@danielleadams danielleadams mentioned this pull request May 3, 2021
MoritzLoewenstein pushed a commit to MoritzLoewenstein/node that referenced this pull request Aug 21, 2021
Refs: nodejs#38004 (comment)

PR-URL: nodejs#38061
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MoritzLoewenstein pushed a commit to MoritzLoewenstein/node that referenced this pull request Aug 21, 2021
Refs: nodejs#38004 (comment)

PR-URL: nodejs#38061
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MoritzLoewenstein pushed a commit to MoritzLoewenstein/node that referenced this pull request Aug 25, 2021
Refs: nodejs#38004 (comment)

PR-URL: nodejs#38061
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MoritzLoewenstein pushed a commit to MoritzLoewenstein/node that referenced this pull request Sep 1, 2021
Refs: nodejs#38004 (comment)

PR-URL: nodejs#38061
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Sep 4, 2021
Refs: #38004 (comment)

PR-URL: #38061
Backport-PR-URL: #39838
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"fs.chownSync" results in an abort
7 participants