diff --git a/bin/telebitd.js b/bin/telebitd.js index 3fa160f..a5933c0 100755 --- a/bin/telebitd.js +++ b/bin/telebitd.js @@ -571,11 +571,13 @@ function serveControlsHelper() { // mask is so that processes owned by other users // can speak to this process, which is probably root-owned var oldUmask = process.umask(0x0000); - require('mkdirp').sync(path.resolve(state._ipc.path, '..')); + if ('socket' === state._ipc.type) { + require('mkdirp').sync(path.dirname(state._ipc.path)); + } controlServer.listen({ - path: state._ipc.path + path: state._ipc.path || null , host: 'localhost' - //, port: 0 + , port: state._ipc.port || null , writableAll: true , readableAll: true , exclusive: false diff --git a/lib/cli-common.js b/lib/cli-common.js index 728dc36..72424ee 100644 --- a/lib/cli-common.js +++ b/lib/cli-common.js @@ -81,7 +81,9 @@ common.pipename = function (config) { , type: (/^win/i.test(os.platform()) ? 'pipe' : 'socket') }; if ('pipe' === _ipc.type) { - _ipc.path = '\\\\?\\pipe' + _ipc.path.replace(/\//, '\\'); + // https://docs.microsoft.com/en-us/windows/desktop/ipc/pipe-names + // Allows all characters accept backslash as part of the name + _ipc.path = '\\\\.\\pipe\\' + _ipc.path.replace(/\\/g, '/'); } return _ipc; };