FAQ
I've recently been writing lots of little node services that mimic real
services and use privileged ports, and so I've been accumulating strategies
for
downgrading to a more restricted user after the ports been acquired via
process.setuid/setguid. There turns out to be enough subtlety in this
  (e.g. setuid("123") and setuid(123) are not at all the same thing) that I
decided to make it a stand-alone utility to maybe spare someone else a few
minutes of pain.

Details here https://github.com/femto113/node-downgrade-identity

By default it supports using SUDO environment variables and npm command
line arguments, so with a server.js like

     var server = require("http").createServer().on("listening",
require("downgrade-identity"));
     server.listen(80);

both

     % sudo node server.js

and

     % sudo npm start --setuid=something --setgid=something

"just work", and with a couple lines of code you can make it work with a
command line parser like optimist as well.


--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupnodejs @
categoriesnodejs
postedJul 25, '13 at 11:53p
activeJul 25, '13 at 11:53p
posts1
users1
websitenodejs.org
irc#node.js

1 user in discussion

Ken: 1 post

People

Translate

site design / logo © 2022 Grokbase