Browse Source

test: root can connect to chmod'd pipes

v0.9.1-release
isaacs 13 years ago
parent
commit
d0c010e39b
  1. 6
      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) {
}); });
// On Windows a chmod has no effect on named pipes // On Windows or when running as root, a chmod has no effect on named pipes
if (process.platform !== 'win32') { if (process.platform !== 'win32' && process.getuid() !== 0) {
// Trying to connect to a socket one has no access to should result in EACCES // Trying to connect to a socket one has no access to should result in EACCES
var accessServer = net.createServer(function() { var accessServer = net.createServer(function() {
assert.ok(false); assert.ok(false);
@ -79,7 +79,7 @@ if (process.platform !== 'win32') {
process.on('exit', function() { process.on('exit', function() {
assert.ok(notSocketErrorFired); assert.ok(notSocketErrorFired);
assert.ok(noEntErrorFired); assert.ok(noEntErrorFired);
if (process.platform !== 'win32') { if (process.platform !== 'win32' && process.getuid() !== 0) {
assert.ok(accessErrorFired); assert.ok(accessErrorFired);
} }
}); });

Loading…
Cancel
Save