From ff6bdd67a4c04cb44c4e93f51bdcf080287b2eb0 Mon Sep 17 00:00:00 2001 From: Jared Meit Date: Thu, 5 Oct 2017 18:33:11 -0400 Subject: [PATCH] Allow mixing of args uid and gid Reversed the order of setting uid and gid. When uid is set first, the process doesn't have permission to set the gid. So they've been swapped. --- lib/ProcessContainerFork.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ProcessContainerFork.js b/lib/ProcessContainerFork.js index fdcd12e6..935654b8 100644 --- a/lib/ProcessContainerFork.js +++ b/lib/ProcessContainerFork.js @@ -52,10 +52,10 @@ 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.setuid(process.env.uid); } catch(e) { setTimeout(function() { console.error('%s on call %s', e.message, e.syscall);