We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 932a5d7 commit f808e7aCopy full SHA for f808e7a
2 files changed
lib/net.js
@@ -2014,6 +2014,12 @@ Server.prototype.listen = function(...args) {
2014
// (path[, backlog][, cb]) or (options[, cb])
2015
// where path or options.path is a UNIX domain socket or Windows pipe
2016
if (options.path && isPipeName(options.path)) {
2017
+ // We can not call fchmod on abstract unix socket
2018
+ if (options.path[0] === '\0' &&
2019
+ (options.readableAll || options.writableAll)) {
2020
+ const msg = 'can not set readableAll or writableAllt to true when path is abstract unix socket';
2021
+ throw new ERR_INVALID_ARG_VALUE('options', options, msg);
2022
+ }
2023
const pipeName = this._pipeName = options.path;
2024
backlog = options.backlog || backlogFromArgs;
2025
listenInCluster(this,
test/parallel/test-pipe-abstract-socket.js
@@ -0,0 +1,34 @@
1
+'use strict';
2
+const common = require('../common');
3
+const assert = require('assert');
4
+const net = require('net');
5
+
6
+if (!common.isLinux) common.skip();
7
8
+const path = '\0abstract';
9
+const message = /can not set readableAll or writableAllt to true when path is abstract unix socket/;
10
11
+assert.throws(() => {
12
+ const server = net.createServer(common.mustNotCall());
13
+ server.listen({
14
+ path,
15
+ readableAll: true
16
+ });
17
+}, message);
18
19
20
21
22
23
+ writableAll: true
24
25
26
27
28
29
30
31
+ readableAll: true,
32
33
34
0 commit comments