Skip to content

Commit

Permalink
Merge pull request Unitech#3204 from jmeit/master
Browse files Browse the repository at this point in the history
Given --uid add all its gids automatically
  • Loading branch information
Unitech authored Oct 10, 2017
2 parents e87896c + 0842176 commit 124139b
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.initgroups(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 124139b

Please sign in to comment.