-
-
Notifications
You must be signed in to change notification settings - Fork 32k
fs: special input -1
on chown
, lchown
and fchown
#58836
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
base: main
Are you sure you want to change the base?
Conversation
I didn't see any test about valid input in chown. well do we need add one? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #58836 +/- ##
==========================================
- Coverage 90.08% 90.07% -0.01%
==========================================
Files 640 640
Lines 188375 188447 +72
Branches 36939 36966 +27
==========================================
+ Hits 169698 169745 +47
- Misses 11397 11405 +8
- Partials 7280 7297 +17
🚀 New features to boost your workflow:
|
f912834
to
6fa93e5
Compare
-1
input on chown
-1
on chown
, lchown
and fchown
74479c1
to
64f6f95
Compare
64f6f95
to
0a3e989
Compare
CHECK(value->IsUint32()); | ||
} else { | ||
CHECK(value->IsNumber()); | ||
} | ||
return static_cast<T>(value.As<v8::Uint32>()->Value()); |
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.
Pretty sure that at least according to the V8 API contract, IsUint32()
is a prerequisite for this case to be valid in the first place – overall, I'd say it's better to handle these values in the *Chown
functions rather than in the generic helpers here
Commit Queue failed- Loading data for nodejs/node/pull/58836 ✔ Done loading data for nodejs/node/pull/58836 ----------------------------------- PR info ------------------------------------ Title fs: special input `-1` on `chown`, `lchown` and `fchown` (#58836) Author Alex Yang <[email protected]> (@himself65) Branch himself65:himself65/2025/06/25/loose -> nodejs:main Labels c++, fs, needs-ci Commits 1 - fs: special input `-1` on `chown`, `lchown` and `fchown` Committers 1 - Alex Yang <[email protected]> PR-URL: https://github.com/nodejs/node/pull/58836 Fixes: https://github.com/nodejs/node/issues/58826 Reviewed-By: Joyee Cheung <[email protected]> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/58836 Fixes: https://github.com/nodejs/node/issues/58826 Reviewed-By: Joyee Cheung <[email protected]> -------------------------------------------------------------------------------- ℹ This PR was created on Wed, 25 Jun 2025 17:35:29 GMT ✔ Approvals: 1 ✔ - Joyee Cheung (@joyeecheung) (TSC): https://github.com/nodejs/node/pull/58836#pullrequestreview-2965372044 ✘ This PR needs to wait 116 more hours to land (or 0 hours if there is one more approval) ✔ Last GitHub CI successful ℹ Last Full PR CI on 2025-06-27T20:21:59Z: https://ci.nodejs.org/job/node-test-pull-request/67691/ - Querying data for job/node-test-pull-request/67691/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/15936207250 |
Fixes: #58826
-1
is a special input for chown, means won't change anything according to the spec.https://stackoverflow.com/questions/21370094/is-the-uid-t-type-signed-or-unsigned