From ca0f0c40861a21b4cdde5517762f3f609e3725ce Mon Sep 17 00:00:00 2001 From: bush6 Date: Tue, 24 Feb 2015 08:08:43 +1000 Subject: [PATCH] set uid timeout Allow the timeout to be changed allowing more time before dropping root privledges --- config.template.yaml | 2 ++ lib/config.js | 3 ++- lib/setuid.js | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config.template.yaml b/config.template.yaml index d325dead..d92d6fd4 100644 --- a/config.template.yaml +++ b/config.template.yaml @@ -198,3 +198,5 @@ setuid: enabled: false group: 'users' user: 'user' +# how long to wait in ms before changing uid/gid + timeout: 15 diff --git a/lib/config.js b/lib/config.js index 686d85eb..5b849d0f 100644 --- a/lib/config.js +++ b/lib/config.js @@ -103,7 +103,8 @@ var defaults = { setuid: { enabled: false, "group": "users", - "user": "nobody" + "user": "nobody", + "timeout": 15 }, }; diff --git a/lib/setuid.js b/lib/setuid.js index da29266e..82345531 100644 --- a/lib/setuid.js +++ b/lib/setuid.js @@ -11,5 +11,5 @@ if (Config.get("setuid.enabled")) { console.log('Cowardly refusing to keep the process alive as root.'); process.exit(1); } - }, 15); + }, (Config.get("setuid.timeout"))); };