From aa358dc138805839c3d00132af9166210c0effca Mon Sep 17 00:00:00 2001 From: Steve Youngs Date: Sun, 16 May 2021 20:28:40 +1000 Subject: [PATCH] Allow pkgusrs to update system mandb via sudo Signed-off-by: Steve Youngs --- etc/sudoers.d/99-pkgusr | 5 +++-- usr/lib/pkgusr/mandb | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100755 usr/lib/pkgusr/mandb diff --git a/etc/sudoers.d/99-pkgusr b/etc/sudoers.d/99-pkgusr index 7e88f25..0dd3f0c 100644 --- a/etc/sudoers.d/99-pkgusr +++ b/etc/sudoers.d/99-pkgusr @@ -1,12 +1,13 @@ #### # -# To allow pkgusr users to run ldconfig as root. +# To allow pkgusr users to run ldconfig and mandb as root. # #### Cmnd_Alias LDCONFIG = /usr/sbin/ldconfig * +Cmnd_Alias MANDB = /usr/bin/mandb User_Alias PKGUSRS = %install Defaults:PKGUSRS !lecture, !authenticate -PKGUSRS ALL = LDCONFIG +PKGUSRS ALL = LDCONFIG, MANDB diff --git a/usr/lib/pkgusr/mandb b/usr/lib/pkgusr/mandb new file mode 100755 index 0000000..266fa57 --- /dev/null +++ b/usr/lib/pkgusr/mandb @@ -0,0 +1,15 @@ +#!/bin/bash +# Copyright © 2021 Steve Youngs All rights reserved. +# SPDX-License-Identifer: BSD-3-Clause + +#### +# +# Call mandb with sudo to update the system db +# +#### + +[[ -x $(type -p sudo) ]] && sudo /usr/bin/mandb -q + +# Local variables: +# sh-basic-offset: 4 +# End: -- 2.25.1