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

Add run0 as a way to raise privileges #14037

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion docs/markdown/Installing.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ running `sudo meson install` will drop permissions and rebuild out of date
targets as the original user, not as root.

*(since 1.1.0)* Re-invoking as root will try to guess the user's preferred method for
re-running commands as root. The order of precedence is: sudo, doas, pkexec
re-running commands as root. The order of precedence is: sudo, doas, run0, pkexec
(polkit). An elevation tool can be forced by setting `$MESON_ROOT_CMD`.

## DESTDIR support
Expand Down
7 changes: 6 additions & 1 deletion mesonbuild/minstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,12 @@ def do_install(self, datafilename: str) -> None:
if is_windows() or destdir != '' or not os.isatty(sys.stdout.fileno()) or not os.isatty(sys.stderr.fileno()):
# can't elevate to root except in an interactive unix environment *and* when not doing a destdir install
raise
rootcmd = os.environ.get('MESON_ROOT_CMD') or shutil.which('sudo') or shutil.which('doas')
rootcmd = (
os.environ.get('MESON_ROOT_CMD')
or shutil.which('sudo')
or shutil.which('doas')
or shutil.which('run0')
)
pkexec = shutil.which('pkexec')
if rootcmd is None and pkexec is not None and 'PKEXEC_UID' not in os.environ:
rootcmd = pkexec
Expand Down
Loading