test,zos: use gid=-1 to test spawn_setgid_fails
This is because on some platforms like z/OS, setgid(0) is allowed for non-superusers. So instead, use setgid(-1) to get UV_EINVAL to test that spawn failure returns the right return code. PR-URL: https://github.com/libuv/libuv/pull/1456 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
This commit is contained in:
parent
5e2fbe5994
commit
f9823e5c12
@ -1351,10 +1351,14 @@ TEST_IMPL(spawn_setgid_fails) {
|
|||||||
init_process_options("spawn_helper1", fail_cb);
|
init_process_options("spawn_helper1", fail_cb);
|
||||||
|
|
||||||
options.flags |= UV_PROCESS_SETGID;
|
options.flags |= UV_PROCESS_SETGID;
|
||||||
|
#if defined(__MVS__)
|
||||||
|
options.gid = -1;
|
||||||
|
#else
|
||||||
options.gid = 0;
|
options.gid = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
r = uv_spawn(uv_default_loop(), &process, &options);
|
r = uv_spawn(uv_default_loop(), &process, &options);
|
||||||
#if defined(__CYGWIN__)
|
#if defined(__CYGWIN__) || defined(__MVS__)
|
||||||
ASSERT(r == UV_EINVAL);
|
ASSERT(r == UV_EINVAL);
|
||||||
#else
|
#else
|
||||||
ASSERT(r == UV_EPERM);
|
ASSERT(r == UV_EPERM);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user