diff options
Diffstat (limited to 'xmake/core/main.lua')
| -rw-r--r-- | xmake/core/main.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/xmake/core/main.lua b/xmake/core/main.lua index b4ca6afab..cda338294 100644 --- a/xmake/core/main.lua +++ b/xmake/core/main.lua @@ -32,6 +32,7 @@ local utils = require("base/utils") local option = require("base/option") local profiler = require("base/profiler") local deprecated = require("base/deprecated") +local privilege = require("base/privilege") local task = require("project/task") local history = require("project/history") @@ -143,12 +144,14 @@ function main.done() -- check run command as root if not option.get("root") then if os.isroot() then - utils.error([[Running xmake as root is extremely dangerous and no longer supported. + if not privilege.store() or os.isroot() then + utils.error([[Running xmake as root is extremely dangerous and no longer supported. As xmake does not drop privileges on installation you would be giving all build scripts full access to your system. Or you can add `--root` option to allow run as root temporarily. - ]]) - return -1 + ]]) + return -1 + end end end |
