Skip to content
This repository
Browse code

test: root can connect to chmod'd pipes

  • Loading branch information...
commit d0c010e39beae175ecfdb213ec898dd88aefbb03 1 parent b48f7f7
Isaac Z. Schlueter isaacs authored

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. +3 3 test/simple/test-net-pipe-connect-errors.js
6 test/simple/test-net-pipe-connect-errors.js
@@ -53,8 +53,8 @@ noEntSocketClient.on('error', function(err) {
53 53 });
54 54
55 55
56   -// On Windows a chmod has no effect on named pipes
57   -if (process.platform !== 'win32') {
  56 +// On Windows or when running as root, a chmod has no effect on named pipes
  57 +if (process.platform !== 'win32' && process.getuid() !== 0) {
58 58 // Trying to connect to a socket one has no access to should result in EACCES
59 59 var accessServer = net.createServer(function() {
60 60 assert.ok(false);
@@ -79,7 +79,7 @@ if (process.platform !== 'win32') {
79 79 process.on('exit', function() {
80 80 assert.ok(notSocketErrorFired);
81 81 assert.ok(noEntErrorFired);
82   - if (process.platform !== 'win32') {
  82 + if (process.platform !== 'win32' && process.getuid() !== 0) {
83 83 assert.ok(accessErrorFired);
84 84 }
85 85 });

0 comments on commit d0c010e

Please sign in to comment.
Something went wrong with that request. Please try again.