From 31723b3943baa14269be93abcb03e1ffe44a3407 Mon Sep 17 00:00:00 2001 From: davidovski Date: Sun, 6 Feb 2022 14:15:05 +0000 Subject: adde a few extra utilities --- repo/util/sudo.xibuild | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 repo/util/sudo.xibuild (limited to 'repo/util/sudo.xibuild') diff --git a/repo/util/sudo.xibuild b/repo/util/sudo.xibuild new file mode 100644 index 0000000..a613ccb --- /dev/null +++ b/repo/util/sudo.xibuild @@ -0,0 +1,49 @@ +#!/bin/bash + +MAKEDEPS=(make ) +DEPS=(glibc libldap openssl pam zlib) + +PKG_VER=1.9.9 +SOURCE=https://www.sudo.ws/dist/sudo-$PKG_VER.tar.gz +DESC="Give certain users the ability to run some commands as root" + +build () { + ./configure --prefix=/usr \ + --libexecdir=/usr/lib \ + --with-secure-path \ + --with-all-insults \ + --with-env-editor \ + --docdir=/usr/share/doc/sudo-1.9.9 \ + --with-passprompt="[sudo] password for %p: " && + make + +} + +package () { + make DESTDIR=$PKG_DEST install && + ln -sfv libsudo_util.so.0.0.0 $PKG_DEST/usr/lib/sudo/libsudo_util.so.0 + + cat > $PKG_DEST/etc/sudoers.d/00-sudo << "EOF" +Defaults secure_path="/usr/sbin:/usr/bin" +%wheel ALL=(ALL) ALL +EOF + + cat > $PKG_DEST/etc/pam.d/sudo << "EOF" +# Begin /etc/pam.d/sudo + +# include the default auth settings +auth include system-auth + +# include the default account settings +account include system-account + +# Set default environment variables for the service user +session required pam_env.so + +# include system session defaults +session include system-session + +# End /etc/pam.d/sudo +EOF + chmod 644 $PKG_DEST/etc/pam.d/sudo +} -- cgit v1.2.1