Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

500 Error Unknown Stat... #390

Closed
bscarvell opened this Issue Apr 26, 2012 · 8 comments

Comments

Projects
None yet
3 participants

Using: Express 3.0 (reported issue visionmedia/express#1110 (comment))

500 Error: UNKNOWN, stat 'D:\USERDATA\ScarvelB\Desktop\opeth\public\wqerty<'

If params.id contains < or > in windows, throws that error.

Contributor

bnoordhuis commented Apr 26, 2012

Sanity check, does this script throw an error?

require('fs').statSync('D:\\USERDATA\\ScarvelB\\Desktop\\opeth\\public\\wqerty<');

Sure does:

 Error: UNKNOWN, unknown error 'D:\USERDATA\ScarvelB\Desktop\opeth\public\wqerty<...
Contributor

bnoordhuis commented Apr 27, 2012

Okay, thanks.

@piscisaureus: Can you check this out?

Member

piscisaureus commented Apr 27, 2012

@bnoordhuis We have to add a mapping for ERROR_BAD_PATHNAME. Mapping it to ENOENT in the stat case is probably fine. However I don't know what to report when open() is attempted with an invalid filename. Apparently POSIX does not specify an error for this case (which makes sense because invalid path names do not exist on unix).

Contributor

bnoordhuis commented Apr 27, 2012

Maybe translate ERROR_BAD_PATHNAME to ERROR_FILE_NOT_FOUND or ERROR_PATH_NOT_FOUND? Like you say, there is no concept of an invalid path on Unices so uv-win is allowed to cheat here.

Member

piscisaureus commented Apr 27, 2012

@bnoordhuis Well I could just translate it to UV_ENOENT.

But the alternative would be to add UV_EBADNAME or UV_ELNAME or something.

Contributor

bnoordhuis commented Apr 27, 2012

Well I could just translate it to UV_ENOENT.

Right, that's more or less what I mean. UV_EBADNAME would be meaningless on other platforms, let's not add that.

Member

piscisaureus commented Apr 27, 2012

Fixed in aea5db5.

@saghul saghul added a commit to libuv/libuv that referenced this issue Nov 20, 2015

@tkelman @saghul tkelman + saghul win: map ERROR_BAD_PATHNAME to UV_ENOENT
e.g. when trying to call uv_fs_stat on "Z:\\:\\a" for a network drive Z:

Refs: joyent/libuv#390
PR-URL: #623
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
7b9bc28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment