Skip to content

Commit

Permalink
win: map ERROR_ELEVATION_REQUIRED to UV_EACCES
Browse files Browse the repository at this point in the history
uv_spawn() on Windows will fail with ERROR_ELEVATION_REQUIRED
if attempting to run an application that requires elevation.

Fixes: nodejs/node#9464
PR-URL: libuv#1154
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
  • Loading branch information
richardlau authored and jBarz committed Jan 17, 2017
1 parent bb44d28 commit 818f80a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/win/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ int uv_translate_sys_error(int sys_errno) {
switch (sys_errno) {
case ERROR_NOACCESS: return UV_EACCES;
case WSAEACCES: return UV_EACCES;
case ERROR_ELEVATION_REQUIRED: return UV_EACCES;
case ERROR_ADDRESS_ALREADY_ASSOCIATED: return UV_EADDRINUSE;
case WSAEADDRINUSE: return UV_EADDRINUSE;
case WSAEADDRNOTAVAIL: return UV_EADDRNOTAVAIL;
Expand Down
1 change: 1 addition & 0 deletions test/test-error.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ TEST_IMPL(error_message) {
TEST_IMPL(sys_error) {
#if defined(_WIN32)
ASSERT(uv_translate_sys_error(ERROR_NOACCESS) == UV_EACCES);
ASSERT(uv_translate_sys_error(ERROR_ELEVATION_REQUIRED) == UV_EACCES);
ASSERT(uv_translate_sys_error(WSAEADDRINUSE) == UV_EADDRINUSE);
ASSERT(uv_translate_sys_error(ERROR_BAD_PIPE) == UV_EPIPE);
#else
Expand Down

0 comments on commit 818f80a

Please sign in to comment.