diff options
| author | ruki <[email protected]> | 2023-12-17 21:47:13 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-12-17 21:47:13 +0800 |
| commit | 90cdfd82d7f32dbf826516a0438faefda12c5162 (patch) | |
| tree | cae143715bc3863758e98121694cd1e01ed7ed6c /xmake/core/main.lua | |
| parent | bfd14e45ff965f94485251db72cac1771ce78be5 (diff) | |
Update main.lua
Diffstat (limited to 'xmake/core/main.lua')
| -rw-r--r-- | xmake/core/main.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/xmake/core/main.lua b/xmake/core/main.lua index f3412d1d1..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' and os.host() ~= 'haiku' 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 |
