Skip to content

Commit

Permalink
Merge pull request Unitech#1 from jmeit/mix-uid-gid
Browse files Browse the repository at this point in the history
Allow mixing of args uid and gid
  • Loading branch information
jmeit authored Oct 9, 2017
2 parents fcaf6ba + 0bd6aa3 commit 8bd018d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/ProcessContainerFork.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,13 @@ if (process.connected &&
// uid/gid management
if (process.env.uid || process.env.gid) {
try {
if (process.env.uid)
process.setuid(process.env.uid);
if (process.env.gid)
process.setgid(process.env.gid);
if (process.env.uid){
process.initgid(process.env.uid, process.env.uid);
process.setgid(process.env.uid);
process.setuid(process.env.uid);
}
} catch(e) {
setTimeout(function() {
console.error('%s on call %s', e.message, e.syscall);
Expand Down

0 comments on commit 8bd018d

Please sign in to comment.