From d0a955ad4254b4f247d60173b697ed5fa1216b08 Mon Sep 17 00:00:00 2001 From: Raboneko <119771935+raboneko@users.noreply.github.com> Date: Tue, 21 Oct 2025 20:43:27 -0700 Subject: [PATCH] add: run0-sudo-shim (#6786) (#6817) --- anda/langs/rust/run0-sudo-shim/anda.hcl | 5 +++ .../rust/run0-sudo-shim/run0-sudo-shim.spec | 35 +++++++++++++++++++ anda/langs/rust/run0-sudo-shim/update.rhai | 1 + 3 files changed, 41 insertions(+) create mode 100644 anda/langs/rust/run0-sudo-shim/anda.hcl create mode 100644 anda/langs/rust/run0-sudo-shim/run0-sudo-shim.spec create mode 100644 anda/langs/rust/run0-sudo-shim/update.rhai diff --git a/anda/langs/rust/run0-sudo-shim/anda.hcl b/anda/langs/rust/run0-sudo-shim/anda.hcl new file mode 100644 index 0000000000..0f265cdc41 --- /dev/null +++ b/anda/langs/rust/run0-sudo-shim/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "run0-sudo-shim.spec" + } +} diff --git a/anda/langs/rust/run0-sudo-shim/run0-sudo-shim.spec b/anda/langs/rust/run0-sudo-shim/run0-sudo-shim.spec new file mode 100644 index 0000000000..57c6aa373b --- /dev/null +++ b/anda/langs/rust/run0-sudo-shim/run0-sudo-shim.spec @@ -0,0 +1,35 @@ +Name: run0-sudo-shim +Version: 1.2.0 +Release: 1%?dist +Summary: An imitation of sudo, using run0 internally +SourceLicense: BSD-3-Clause +License: (Apache-2.0 OR MIT) AND BSD-3-Clause AND MIT +URL: https://github.com/LordGrimmauld/run0-sudo-shim +Source0: %url/archive/refs/tags/%version.tar.gz +BuildRequires: rpm_macro(cargo_install) rust-packaging +Conflicts: sudo + +%description +run0-sudo-shim attempts to imitate sudo as close as possible, while actually using run0 in the back. + +run0 does not rely on SUID binaries, which makes it a more secure option. It is also included in any systemd-based linux installation. + +However, many programs just expect sudo to exist, so a shim is necessary to make those programs work. + +%prep +%autosetup +%cargo_prep_online + +%build +%cargo_license_summary_online +%{cargo_license_online} > LICENSE.dependencies + +%install +%cargo_install +ln -s %_bindir/run0-sudo-shim %buildroot%_bindir/sudo + +%files +%doc README.md +%license LICENSE.dependencies +%_bindir/run0-sudo-shim +%_bindir/sudo diff --git a/anda/langs/rust/run0-sudo-shim/update.rhai b/anda/langs/rust/run0-sudo-shim/update.rhai new file mode 100644 index 0000000000..91da40d59f --- /dev/null +++ b/anda/langs/rust/run0-sudo-shim/update.rhai @@ -0,0 +1 @@ +rpm.version(gh("LordGrimmauld/run0-sudo-shim"));