This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

test: root can connect to chmod'd pipes

  • Loading branch information...
1 parent b48f7f7 commit d0c010e39beae175ecfdb213ec898dd88aefbb03 @isaacs isaacs committed May 20, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 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);
}
});

0 comments on commit d0c010e

Please sign in to comment.