summaryrefslogtreecommitdiff
path: root/repo/util/sudo
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-05-04 23:52:30 +0100
committerdavidovski <david@davidovski.xyz>2022-05-04 23:52:30 +0100
commit739c65c54cb0e957df5e9b76f93fb02554e5cac3 (patch)
tree09ddfa0a342f3ea9de136cb50abdd79821bf1b53 /repo/util/sudo
parent4c585ad54388285500fd18a6aaa516894e0f2c16 (diff)
moved everything to new file formatting
Diffstat (limited to 'repo/util/sudo')
-rw-r--r--repo/util/sudo/sudo.xibuild50
1 files changed, 50 insertions, 0 deletions
diff --git a/repo/util/sudo/sudo.xibuild b/repo/util/sudo/sudo.xibuild
new file mode 100644
index 0000000..dbb08f7
--- /dev/null
+++ b/repo/util/sudo/sudo.xibuild
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+MAKEDEPS="make "
+DEPS="musl 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 -sf 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) ALL
+EOF
+
+ mkdir -p $PKG_DEST/etc/pam.d
+ 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
+}