From b242248188806041443d6ed0264f5b539f9ca65d Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Thu, 8 Mar 2018 00:09:24 +0100 Subject: [PATCH] net: allow IPC servers be accessible by all Adds mappings to uv_pipe_chmod call by adding two new options to listen call. This allows the IPC server pipe to be made readable or writable by all users. Fixes: https://github.com/nodejs/node/issues/19154 PR-URL: https://github.com/nodejs/node/pull/19472 Reviewed-By: Santiago Gimeno Reviewed-By: Anna Henningsen --- doc/api/net.md | 8 ++++++++ lib/net.js | 13 ++++++++++++ src/pipe_wrap.cc | 15 ++++++++++++++ src/pipe_wrap.h | 1 + test/parallel/test-net-server-listen-path.js | 21 ++++++++++++++++++++ 5 files changed, 58 insertions(+) diff --git a/doc/api/net.md b/doc/api/net.md index 5ac60403e5ee02..e48bdc1eaaf3b7 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -260,6 +260,10 @@ added: v0.11.14 * `backlog` {number} Common parameter of [`server.listen()`][] functions. * `exclusive` {boolean} **Default:** `false` + * `readableAll` {boolean} For IPC servers makes the pipe readable + for all users. **Default:** `false` + * `writableAll` {boolean} For IPC servers makes the pipe writable + for all users. **Default:** `false` * `callback` {Function} Common parameter of [`server.listen()`][] functions. * Returns: {net.Server} @@ -285,6 +289,10 @@ server.listen({ }); ``` +Starting an IPC server as root may cause the server path to be inaccessible for +unprivileged users. Using `readableAll` and `writableAll` will make the server +accessible for all users. + #### server.listen(path[, backlog][, callback])