-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
fs: fix chown abort #38004
Conversation
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
@@ -8,6 +8,9 @@ const kReadFileBufferLength = 512 * 1024; | |||
const kReadFileUnknownBufferLength = 64 * 1024; | |||
const kWriteFileMaxChunkSize = 512 * 1024; | |||
|
|||
// 2 ** 32 - 1 | |||
const kMaxUserId = 4294967295; |
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.
Why this value? Is this documented somewhere? Could you add a comment explaining where does it come from please?
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 actually pasted it from:
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?
Nice, though looks like #37997 was opened already? |
CI broken |
@benjamingr I opened this as it has a different approach of fixing the issue. Also, #37997 (comment). |
@ycjcl868 The Github Actions CI seems to be fixed now. Started the Jenkins CI run. |
Landed in e9ed113 |
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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