Skip to content

Commit

Permalink
Merge pull request #4513 from cmeerw/skip-root-check-on-haiku
Browse files Browse the repository at this point in the history
Skip root user check on Haiku OS
  • Loading branch information
waruqi authored Dec 17, 2023
2 parents ccbcebd + 90cdfd8 commit bf905b6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion xmake/core/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bf905b6

Please sign in to comment.