Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upfs: too strict range check on 'mode' parameter #20498
Comments
This comment has been minimized.
This comment has been minimized.
arantes555
commented
May 3, 2018
|
Seeing the same issue here. Breaking In my case, I only see the issue when running on CI... |
This comment has been minimized.
This comment has been minimized.
|
cc @targos @BridgeAR We discussed about unifying this check in #19973 (review) I am leaning towards masking off the relevant bits since that's what the underlying POSIX API usually does. |
joyeecheung
added
fs
errors
labels
May 4, 2018
This comment has been minimized.
This comment has been minimized.
joyeecheung
self-assigned this
May 4, 2018
This comment has been minimized.
This comment has been minimized.
|
I'm good with masking off the bits and relaxing the check :) |
This comment has been minimized.
This comment has been minimized.
|
Also, it's obvious we don't have good test coverage for this particular case so it would be good to expand that a bit. |
addaleax
added
confirmed-bug
v10.x
labels
May 4, 2018
This comment has been minimized.
This comment has been minimized.
|
I also agree that masking off seems the right thing to do. |
This comment has been minimized.
This comment has been minimized.
|
Hi,
|
This comment has been minimized.
This comment has been minimized.
ar-stackrox
commented
May 7, 2018
|
I'm having the same issue above with Gulp 4(graceful-fs) in my local build. What can I do to fix this? |
This comment has been minimized.
This comment has been minimized.
seeker5084
commented
May 8, 2018
|
same here. |
This comment has been minimized.
This comment has been minimized.
seeker5084
commented
May 10, 2018
•
|
graceful-fs's RangeError [ERR_OUT_OF_RANGE] solved by #20588. |
joyeecheung
referenced this issue
May 16, 2018
Closed
lib: mask mode_t type of arguments with 0o777 #20636
demurgos
referenced this issue
May 16, 2018
Closed
Gulp 4: The value of "mode" is out of range. Received 33279" #2177
joyeecheung
closed this
in
a18e130
May 17, 2018
joyeecheung
added a commit
that referenced
this issue
May 17, 2018
cjihrig
added a commit
to cjihrig/node-1
that referenced
this issue
May 20, 2018
cjihrig
added a commit
to cjihrig/node-1
that referenced
this issue
May 20, 2018
shisama
added a commit
to shisama/node
that referenced
this issue
May 30, 2018
shisama
added a commit
to shisama/node
that referenced
this issue
May 30, 2018
shisama
added a commit
to shisama/node
that referenced
this issue
May 30, 2018
shisama
added a commit
to shisama/node
that referenced
this issue
May 30, 2018
shisama
added a commit
to shisama/node
that referenced
this issue
May 30, 2018
shisama
added a commit
to shisama/node
that referenced
this issue
May 30, 2018
shisama
added a commit
to shisama/node
that referenced
this issue
May 30, 2018
This comment has been minimized.
This comment has been minimized.
Delagen
commented
Jun 14, 2018
|
When it will be in master? 10.4.1 released but still |
This comment has been minimized.
This comment has been minimized.
|
@Delagen It's on v10.x-staging now, should be available in the next release. |
This comment has been minimized.
This comment has been minimized.
Delagen
commented
Jun 14, 2018
|
@joyeecheung This was broken for about 7 releases of 10.x branch. Speed of fixes make me sad ( |
This comment has been minimized.
This comment has been minimized.
|
Comments like yours make me sad. It adds nothing except another notification email to 100+ people. |
rubycon commentedMay 3, 2018
•
edited
Since version 10, function like
fs.chmod()orfs.mkdir()check if theirmodeparameter is belowo777throwing a RangeError exception if the condition isn't satisfied.This requirement is too strict as the mode parameter can often be above
o777if it need to set theS_ISUIDorS_ISGIDbits.Furthermore this range check break several node packages (e.g.
graceful-fsused by over 1400 other packages) in a very common scenario:A program wants to create a new file/directory with the same rights that a reference file/directory. Often the
modeattribute offs.Statsobject is directly passed tofs.chmod()orfs.mkdir(). However thefs.Stats.modeis always aboveo777(e.g.o100644) since it also contains the file type bits.Classic POSIX version of
chmodormkdirseems to handle those kind a values without complaining by discarding the irrelevant bits instead of throwing an error. Why do Node need to be so brutal about it?