pikaur icon indicating copy to clipboard operation
pikaur copied to clipboard

Add support for run0 as privilege escalation tool

Open yannik-b opened this issue 1 year ago β€’ 1 comments

As systemd 256 is available in Arch for a few weeks, which ships with the new escalation tool run0, I would love to see run0 available in pikaur as an alternative to sudo or doas. Are there any plans to implement it?

yannik-b avatar Jul 07 '24 10:07 yannik-b

i would love to see

a) https://github.com/actionless/pikaur/pulls b) https://www.paypal.me/actionless

actionless avatar Jul 07 '24 15:07 actionless

Replacing the default setting of privilegeescalationtool from sudo to run0 does work. My pikaur.conf: `[sync] alwaysshowpkgorigin = no develpkgsexpiration = -1 upgradesorting = versiondiff showdownloadsize = no ignoreoutofdateaurupgrades = no

[build] keepbuilddir = no keepdevbuilddir = yes keepbuilddeps = no gpgdir = skipfailedbuild = no dynamicusers = never ignorearch = no

[review] noedit = no donteditbydefault = no nodiff = no gitdiffargs = --ignore-space-change,--ignore-all-space diffpager = auto hidedifffiles = .SRCINFO

[colors] version = 10 versiondiffold = 11 versiondiffnew = 9

[ui] requireenterconfirm = yes printcommands = no aursearchsorting = hottest displaylastupdated = no groupbyrepository = yes reversesearchsorting = no warnaboutpackageupdates = warnaboutnondefaultprivilegeescalationtool = yes

[misc] cachepath = /home/dylan/.cache datapath = /home/dylan/.local/share pacmanpath = pacman privilegeescalationtool = run0 privilegeescalationtarget = pikaur userid = 0 preserveenv = PKGDEST,VISUAL,EDITOR,http_proxy,https_proxy,ftp_proxy,HTTP_PROXY,HTTPS_PROXY,FTP_PROXY,ALL_PROXY groupid = 0

[network] aururl = https://aur.archlinux.org newsurl = https://archlinux.org/feeds/news/ socks5proxy = aurhttpproxy = aurhttpsproxy =

Example invocation:dylan@dylanarchold ~> pikaur -S screengrab --pikaur-debug πŸš› debug: main_1000_1000: Setting stdout to utf-8... πŸš› debug: main_1000_1000: already set - nothing to do πŸš› debug: main_1000_1000: Setting stderr to utf-8... πŸš› debug: main_1000_1000: already set - nothing to do πŸš› debug: main_1000_1000: Pikaur operation found for args ['/usr/bin/pikaur', '-S', 'screengrab', '--pikaur-debug']: cli_install_packages => run0 -- /usr/bin/pikaur -S screengrab --pikaur-debug --pikaur-config=/home/dylan/.config/pikaur.conf --user-id=1000 --group-id=1000 --home-dir=/home/dylan --xdg-cache-home=/home/dylan/.cache --xdg-data-home=/home/dylan/.local/share πŸš› debug: main_0_0: Setting stdout to utf-8... πŸš› debug: main_0_0: already set - nothing to do πŸš› debug: main_0_0: Setting stderr to utf-8... πŸš› debug: main_0_0: already set - nothing to do πŸš› debug: main_0_0: Pikaur operation found for args ['/usr/bin/pikaur', '-S', 'screengrab', '--pikaur-debug', '--pikaur-config=/home/dylan/.config/pikaur.conf', '--user-id=1000', '--group-id=1000', '--home-dir=/home/dylan', '--xdg-cache-home=/home/dylan/.cache', '--xdg-data-home=/home/dylan/.local/share']: cli_install_packages πŸš› debug: install_info_fetcher: Gonna fetch install info for: install_package_names=['screengrab'] not_found_repo_pkgs_names=[] pkgbuilds_packagelists={} manually_excluded_packages_names=[] skip_checkdeps_for_pkgnames=[]

πŸš› debug: install_info_fetcher: Gonna get repo pkgs install info... Reading repository package databases... Reading local package database... πŸš› debug: install_info_fetcher: Checking if '['screengrab']' is installable: => pacman --color=always --sync screengrab --print-format %r/%n πŸš› debug: install_info_fetcher: Check passed - gonna get install infos: πŸš› debug: install_info_fetcher: gonna get AUR pkgs install info for: aur_packages_versionmatchers=[] self.aur_updates_install_info=[] aur_packages_names_to_versions={} πŸš› debug: install_info_fetcher: found AUR pkgs: aur_pkg_list=[] not found AUR pkgs: not_found_aur_pkgs=[] πŸš› debug: install_info_fetcher: got AUR pkgs install info: [] πŸš› debug: aur_deps: find_aur_deps: package_names=[] πŸš› debug: aur_deps: find_aur_deps: result_aur_deps={} πŸš› debug: install_info_fetcher: get_aur_deps_info: self.aur_deps_relations={} πŸš› debug: install_info_fetcher: get_aur_deps_info: aur_pkgs={} πŸš› debug: install_info_fetcher: get_aur_deps_info: [done] πŸš› debug: install_info_fetcher: get_repo_deps_info: [done] πŸš› debug: install_info_fetcher: :: marking dependant pkgs... πŸš› debug: install_info_fetcher: :: mark_dependant :: get_repo_provided... πŸš› debug: install_info_fetcher: :: mark_dependant :: get local pkgs... πŸš› debug: install_info_fetcher: :: mark_dependant :: all_requested_pkg_names=['screengrab', 'qt6-base', 'kwindowsystem', 'libqtxdg', 'libx11', 'libxcb', 'libQt6Xdg.so=4-64', 'layer-shell-qt'] πŸš› debug: install_info_fetcher: :: mark_dependant :: explicit_aur_pkg_names=[] πŸš› debug: install_info_fetcher: :: mark_dependant :: - screengrab πŸš› debug: install_info_fetcher: :: mark_dependant :: providing_for=[] πŸš› debug: install_info_fetcher: == marked dependant pkgs. πŸš› debug: install_cli: self.install_info.all_install_info_containers=([<RepoInstallInfo "screengrab" 3.0.0-1 -> 3.0.0-1>], [], [], [], [], [], [], [])

πŸš› Repository package will be installed: screengrab 3.0.0-1 -> 3.0.0-1

πŸš› debug: prompt: Gonna get input from user... πŸš› debug: FileLock: Acquiring /tmp/pikaur_prompt_376344.lock... πŸš› debug: FileLock: Acquired /tmp/pikaur_prompt_376344.lock πŸš› debug: prompt_nolock: Restoring TTY... πŸš› debug: prompt_nolock: Using standard input reader... πŸš› Proceed with installation? [Y/n] πŸš› [v]iew package details [m]anually select packages πŸš› [r] show if packages are required by already installed packages

n πŸš› debug: FileLock: Releasing /tmp/pikaur_prompt_376344.lock πŸš› debug: FileLock: Released /tmp/pikaur_prompt_376344.lock πŸš› debug: prompt: Got answer: 'n' πŸš› debug: main_0_0: Restoring stdout... πŸš› debug: main_0_0: nothing to do πŸš› debug: main_0_0: Restoring stderr... πŸš› debug: main_0_0: nothing to do πŸš› debug: main_1000_1000: Restoring stdout... πŸš› debug: main_1000_1000: nothing to do πŸš› debug: main_1000_1000: Restoring stderr... πŸš› debug: main_1000_1000: nothing to do`

Also works with sudo-rs.

Dylan1496 avatar Sep 03 '25 02:09 Dylan1496

if the tool retain compatible (or partially compatible) CLI API with original sudo - it indeed should just work πŸ˜ΊπŸ‘

actionless avatar Sep 03 '25 11:09 actionless