From d0c010e39beae175ecfdb213ec898dd88aefbb03 Mon Sep 17 00:00:00 2001 From: isaacs Date: Sun, 20 May 2012 00:42:07 -0300 Subject: [PATCH] test: root can connect to chmod'd pipes --- test/simple/test-net-pipe-connect-errors.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/simple/test-net-pipe-connect-errors.js b/test/simple/test-net-pipe-connect-errors.js index 627698d947..8200a16cf0 100644 --- a/test/simple/test-net-pipe-connect-errors.js +++ b/test/simple/test-net-pipe-connect-errors.js @@ -53,8 +53,8 @@ noEntSocketClient.on('error', function(err) { }); -// On Windows a chmod has no effect on named pipes -if (process.platform !== 'win32') { +// On Windows or when running as root, a chmod has no effect on named pipes +if (process.platform !== 'win32' && process.getuid() !== 0) { // Trying to connect to a socket one has no access to should result in EACCES var accessServer = net.createServer(function() { assert.ok(false); @@ -79,7 +79,7 @@ if (process.platform !== 'win32') { process.on('exit', function() { assert.ok(notSocketErrorFired); assert.ok(noEntErrorFired); - if (process.platform !== 'win32') { + if (process.platform !== 'win32' && process.getuid() !== 0) { assert.ok(accessErrorFired); } });