diff options
Diffstat (limited to 'rootless.patch')
-rw-r--r-- | rootless.patch | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/rootless.patch b/rootless.patch index 9a17aa176e02..b6cc60a91669 100644 --- a/rootless.patch +++ b/rootless.patch @@ -1,7 +1,7 @@ diff -ura package.orig/src/utils.js package.new/src/utils.js ---- package.orig/src/utils.js 2019-03-02 03:00:07.393462552 +0100 -+++ package.new/src/utils.js 2019-03-02 02:59:53.770016930 +0100 -@@ -17,7 +17,6 @@ +--- package.orig/src/utils.js 2019-03-15 18:59:19.000000000 +0800 ++++ package.new/src/utils.js 2019-03-20 14:42:19.202514790 +0800 +@@ -16,7 +16,6 @@ const tmp = require('tmp'); const exec = require('child_process').exec; const cp = require('child_process'); @@ -9,13 +9,19 @@ diff -ura package.orig/src/utils.js package.new/src/utils.js const winston = require('winston'); const getos = require('getos'); const commandExistsSync = require('command-exists').sync; -@@ -387,8 +386,7 @@ +@@ -375,14 +374,7 @@ } var needRoot = () => { -- if ((os.platform() === "win32") || isSnap()) return false; -- return !process.env.SUDO_UID -+ return false +- if ( +- (os.platform() === "win32") || +- isSnap() || +- !commandExistsSync("sudo") || +- global.installProperties.noRoot || +- global.installProperties.simulate +- ) return false; +- else return !process.env.SUDO_UID ++ return false } var ensureRoot = (m) => { |