summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-12-17 21:53:03 +0800
committerGitHub <[email protected]>2023-12-17 21:53:03 +0800
commitbf905b6fc04afaea0377d0223e745d7793b5d93b (patch)
treebafd422daa5f5bbdefb7155cf7c37336ee8e1007
parentccbcebdd9e2cb187d1621188a6dff7006a2c8155 (diff)
parent90cdfd82d7f32dbf826516a0438faefda12c5162 (diff)
Merge pull request #4513 from cmeerw/skip-root-check-on-haiku
Skip root user check on Haiku OS
-rw-r--r--xmake/core/main.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/xmake/core/main.lua b/xmake/core/main.lua
index db284c431..e813c849a 100644
--- a/xmake/core/main.lua
+++ b/xmake/core/main.lua
@@ -238,6 +238,11 @@ function main._exit(ok, errors)
return retval
end
+-- limit root? @see https://github.com/xmake-io/xmake/pull/4513
+function main._limit_root()
+ return not option.get("root") and os.getenv("XMAKE_ROOT") ~= 'y' and os.host() ~= 'haiku'
+end
+
-- the main entry function
function main.entry()
@@ -266,7 +271,7 @@ function main.entry()
end
-- check run command as root
- if not option.get("root") and os.getenv("XMAKE_ROOT") ~= 'y' then
+ if main._limit_root() then
if os.isroot() then
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