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.