Skip to content
Browse files

-

  • Loading branch information...
1 parent 4d9c24f commit 59c29f5da027c51f1a5e0f63d0411baa35c3ef3d @JoeHitchens JoeHitchens committed Feb 28, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 forker.js
View
12 forker.js
@@ -130,8 +130,20 @@ var start = function(e, s) {
log(2, ""+cfg.host+":"+cfg.port)
server.listen(cfg.port, cfg.host, function() {
+
+ if(process.getuid() == 0) {
+ try {
+ process.setgid('nobody')
+ process.setuid('nobody')
+ }
+ catch(e) {
+ log(1, "WARNING: Can't downgrade uid/gid to 'nobody': "+e)
+ }
+ }
+
var a = server.address()
log(2, "listening "+(a.address || "*")+":"+a.port)
+
})
}

0 comments on commit 59c29f5

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