Skip to content
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
11 changes: 11 additions & 0 deletions srcpkgs/sudo-rs/INSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#
# Sets up permissions for /etc/sudoers.
#
case "${ACTION}" in
post)
if [ -f etc/sudoers ]; then
echo "Setting up permissions to /etc/sudoers..."
chmod 0440 etc/sudoers
fi
;;
esac
8 changes: 8 additions & 0 deletions srcpkgs/sudo-rs/REMOVE
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Cleans the sudo ticket database at purge.
#
case "${ACTION}" in
purge)
[ -d var/db/sudo ] && rm -rf var/db/sudo
;;
esac
4 changes: 4 additions & 0 deletions srcpkgs/sudo-rs/files/sudo.pam
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#%PAM-1.0
auth include system-auth
account include system-auth
session include system-auth
68 changes: 68 additions & 0 deletions srcpkgs/sudo-rs/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Template file for 'sudo-rs'
pkgname=sudo-rs
version=0.2.15
revision=1
build_style=cargo
make_build_args="--bin sudo --bin visudo --features gettext"
make_install_args="--path . --bin sudo --bin visudo --features gettext"
hostmakedepends="gettext pkg-config"
makedepends="pam-devel"
short_desc="Memory-safe implementation of sudo"
maintainer="Nafis <mnabid.25@outlook.com>"
license="Apache-2.0 OR MIT"
homepage="https://github.com/trifectatechfoundation/sudo-rs"
distfiles="${homepage}/archive/refs/tags/v${version}.tar.gz"
checksum=ae857c3cde962a1ade2b981f7e01cf95e9fa05d5c5f95f94cf5f35394c1bf899
conflicts="sudo"
replaces="sudo>=0"
conf_files="
/etc/pam.d/sudo
/etc/sudoers"
make_dirs="
/etc/sudoers.d 0750 root root
/var/db/sudo 0750 root root"

make_check=no # tests fail in chroot
# Failed tests:
# common::context::tests::test_build_run_context
# common::resolve::test::canonicalization
# su::context::tests::invalid_shell
# sudo::env::environment::tests::test_tzinfo
# system::audit::test::secure_open_is_predictable
# system::audit::test::test_traverse_secure_open_negative
# system::audit::test::test_traverse_secure_open_positive
# system::interface::test::test_unix_user
# system::tests::test_get_user_and_group_by_id

post_install() {
# sudoers and PAM config
vsed -i docs/sudoers.example -e 's|/usr\(/etc/sudoers\.d\)|\1|'
vinstall docs/sudoers.example 440 etc sudoers
vinstall docs/sudoers.example 664 usr/share/examples/sudo-rs
vinstall ${FILESDIR}/sudo.pam 644 etc/pam.d sudo

# setuid for sudo binary
chmod 4755 ${DESTDIR}/usr/bin/sudo

# documentation
vman docs/man/sudo.8.man sudo.8
vman docs/man/sudoers.5.man sudoers.5
vman docs/man/visudo.8.man visudo.8

# symlink for sudoedit
ln -s sudo ${DESTDIR}/usr/bin/sudoedit
ln -s sudo.8 ${DESTDIR}/usr/share/man/man8/sudoedit.8

# translations
for po in po/*.po; do
if [ -f "${po}" ]; then
lang=$(basename "${po}" .po)
dir="${DESTDIR}/usr/share/locale/${lang}/LC_MESSAGES"
install -d "${dir}"
msgfmt -o "${dir}/sudo-rs.mo" "${po}"
fi
done

vlicense LICENSE-APACHE
vlicense LICENSE-MIT
}