GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — net: check pipe mode and path · nodejs/node@f808e7a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • net.js
  • test/parallel
    • test-pipe-abstract-socket.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/net.js‎

Copy file name to clipboardExpand all lines: lib/net.js
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,6 +2014,12 @@ Server.prototype.listen = function(...args) {
20142014
// (path[, backlog][, cb]) or (options[, cb])
20152015
// where path or options.path is a UNIX domain socket or Windows pipe
20162016
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+
}
20172023
const pipeName = this._pipeName = options.path;
20182024
backlog = options.backlog || backlogFromArgs;
20192025
listenInCluster(this,
Collapse file

‎test/parallel/test-pipe-abstract-socket.js‎

Copy file name to clipboard
+34Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
assert.throws(() => {
20+
const server = net.createServer(common.mustNotCall());
21+
server.listen({
22+
path,
23+
writableAll: true
24+
});
25+
}, message);
26+
27+
assert.throws(() => {
28+
const server = net.createServer(common.mustNotCall());
29+
server.listen({
30+
path,
31+
readableAll: true,
32+
writableAll: true
33+
});
34+
}, message);

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.