Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip root user check on Haiku OS #4513

Merged
merged 2 commits into from
Dec 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading