From 6d8b6dcf982001f1c1fe8789c67e161159065c09 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 --- 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 21d14fc7068bc5..31988d40fd1548 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -259,6 +259,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} @@ -284,6 +288,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])