summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-05-06 11:05:50 +0800
committerruki <[email protected]>2023-05-06 11:05:50 +0800
commitb391073c181286e41b3767dea16433cffca57619 (patch)
treec280cb26b5470a821d7459d35f4d8a25fb3afa48
parent91633b648d6ce1505df22dc1a400e283ea90f512 (diff)
improve root check
-rw-r--r--xmake/core/main.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/xmake/core/main.lua b/xmake/core/main.lua
index 615df5355..bb883d659 100644
--- a/xmake/core/main.lua
+++ b/xmake/core/main.lua
@@ -259,14 +259,12 @@ function main.entry()
-- check run command as root
if not option.get("root") and os.getenv("XMAKE_ROOT") ~= 'y' then
if os.isroot() then
- if not privilege.store() or os.isroot() then
- errors = [[Running xmake as root is extremely dangerous and no longer supported.
+ errors = [[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 or XMAKE_ROOT=y to allow run as root temporarily.
- ]]
- return main._exit(false, errors)
- end
+ ]]
+ return main._exit(false, errors)
end
end