Skip to content

fs: fix chown abort - #38004

Closed
RaisinTen wants to merge 5 commits into
nodejs:masterfrom
RaisinTen:fs/fix-chown-abort
Closed

fs: fix chown abort#38004
RaisinTen wants to merge 5 commits into
nodejs:masterfrom
RaisinTen:fs/fix-chown-abort

Conversation

@RaisinTen

Copy link
Copy Markdown
Member

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-botnodejs-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
const kWriteFileMaxChunkSize = 512 * 1024;

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

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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
constkMaxUserId=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
Copy Markdown
Member

Nice, though looks like #37997 was opened already?

@ycjcl868

Copy link
Copy Markdown
Contributor

CI broken

@RaisinTen

Copy link
Copy Markdown
MemberAuthor

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
Copy Markdown
Collaborator

@RaisinTen

Copy link
Copy Markdown
MemberAuthor

CI broken

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

@RaisinTenRaisinTen 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

Trott commented Apr 3, 2021

Copy link
Copy Markdown
Member

Landed in e9ed113

@TrottTrott 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>
@MylesBorinsMylesBorins 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>
@danielleadamsdanielleadams mentioned this pull request May 3, 2021
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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs 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++.fsIssues and PRs related to the fs subsystem / file system.needs-ciPRs 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

@RaisinTen@benjamingr@ycjcl868@nodejs-github-bot@Trott@addaleax@aduh95