You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows standard user cannot run any node 6 js file on mapped path #7192
The only folder our users can write to is their home at N:\ which is a map of \\servername\share$\students\group\**userHome**. Bold is the only folder that doesn't return a permission error "operation not permitted" with fs.statSync()
run from a normal powershell command prompt;
PS N:\permTest> node .\index.js
fs.js:1568
return binding.realpath(pathModule._makeLong(path), options.encoding);
^
Error: EPERM: operation not permitted, realpath 'N:\permTest\index.js'
at Error (native)
at Object.realpathSync (fs.js:1568:18)
at Function.Module._findPath (module.js:167:25)
at Function.Module._resolveFilename (module.js:438:25)
at Function.Module._load (module.js:388:25)
at Function.Module.runMain (module.js:575:10)
at startup (node.js:160:18)
at node.js:456:3
PS N:\permTest> node
> 1 + 1
2
> fs.readdirSync('.')
[ 'index.js', 'npm-debug.log', 'package.json' ]
> fs.access('.', fs.F_OK, function(err){if (err){ console.log(err)} console.log('yes')})
yes
> fs.access('.', fs.R_OK, function(err){if (err){ console.log(err)} console.log('yes')})
yes
fs.access('.', fs.W_OK, function(err){if (err){ console.log(err)} console.log('yes')})
yes
> fs.access('.', fs.X_OK, function(err){if (err){ console.log(err)} console.log('yes')})
yes
note: permTest/index.js is just a module that does the above pasted fs.access tests.
This happens when trying to execute any file with node.
Probably irrelevant but I've been happily using npm link on a locally attached drive path. But that being an ntfs thing I assume node shouldn't even see it. But I'm not surprised I can't use a symlink on a mapped unc path. Just in case that clarifies anything.
@trevnorris This is the issue referencing that. I plan on looking into it this week (finally). I'm not sure if reparse points (used to implement links on NTFS for example) are the culprit here (I have come to think they aren't), but there is certainly something to be done for mapped drives in uv_fs_realpath.
Yes this is mapped from a fully patch 2012 server. Not r2. I find the issue is when you don't have permissions to access parent folders but you do for the child folder target being mapped.
e.g. \\server\Allstudents\yearX\username obviously the user account only has RWX to username and nothing at all between server\ to server\Allstudents\yearX\
edit: and to be clear N:\ is mapped to \\server\Allstudents\yearX\username
If I can get time I'll test a user that can read the whole folder path. This works for myself as a sysadmin I can get to that whole path.
I wonder if you share a folder and remove your permissions to its parents if osx can show the same behaviour.
Trying to play along at home here too ;) Even if the path n:\ is being resolved to \\a\b\c Why is node trying to do anything to \\a or \\a\b\ which causes it to crash. It only needs to touch \\a\b\c or down to \\a\b\c\node_modules?
Activity
saghul commentedon Jun 22, 2016
I suspect this has to do with our realpath not properly handling reparse points.
Jackbennett commentedon Jun 22, 2016
Probably irrelevant but I've been happily using npm link on a locally attached drive path. But that being an ntfs thing I assume node shouldn't even see it. But I'm not surprised I can't use a symlink on a mapped unc path. Just in case that clarifies anything.
trevnorris commentedon Jul 8, 2016
@saghul
Can you elaborate on this, or is there an issue already addressing this?
saghul commentedon Jul 11, 2016
@trevnorris This is the issue referencing that. I plan on looking into it this week (finally). I'm not sure if reparse points (used to implement links on NTFS for example) are the culprit here (I have come to think they aren't), but there is certainly something to be done for mapped drives in
uv_fs_realpath.saghul commentedon Jul 13, 2016
@Jackbennett Is that a samba share? I just tested it by mapping a share on my OSX laptop and doing a
fs.realpathSyncon it works for me.Jackbennett commentedon Jul 13, 2016
Yes this is mapped from a fully patch 2012 server. Not r2. I find the issue is when you don't have permissions to access parent folders but you do for the child folder target being mapped.
e.g.
\\server\Allstudents\yearX\usernameobviously the user account only hasRWXto username and nothing at all betweenserver\toserver\Allstudents\yearX\edit: and to be clear
N:\is mapped to\\server\Allstudents\yearX\usernameIf I can get time I'll test a user that can read the whole folder path. This works for myself as a sysadmin I can get to that whole path.
I wonder if you share a folder and remove your permissions to its parents if osx can show the same behaviour.
saghul commentedon Jul 13, 2016
@Jackbennett thanks! Just to confirm this is related to #3594 or not: does this work for you on Node v4?
Jackbennett commentedon Jul 13, 2016
We've got a class happily using node v4 anywhere in the school. This was only an issue in a room I deployed v6 to.
saghul commentedon Jul 13, 2016
Damn. Thanks for confirming.
Fishrock123 commentedon Jul 13, 2016
Does #7559 fix this?
addaleax commentedon Jul 13, 2016
/cc @bzoz
I don’t think so, but #7559 should make it easier to fix it.
bzoz commentedon Jul 14, 2016
@addaleax: you are right: #7559 won't fix this, but it sure will make it easy to do so
Jackbennett commentedon Jul 14, 2016
Trying to play along at home here too ;) Even if the path
n:\is being resolved to\\a\b\cWhy is node trying to do anything to\\aor\\a\b\which causes it to crash. It only needs to touch\\a\b\cor down to\\a\b\c\node_modules?fs: restore JS implementation of realpath
fs: restore JS implementation of realpath