Package does not consider /etc/sudoers.d permission

Description:

The folder /etc/sudoers.d in the filesystem has the permission 750:

~]# ls -ld /etc/sudoers.d 
drwxr-x--- 1 root root 36  4. Mär 2024  /etc/sudoers.d

The package produces during the installation or update a warning:

warning: directory permissions differ on /etc/sudoers.d/
filesystem: 750  package: 755

To consider the filesystem's permission the package() function in PKGBUILD should be adjusted a bit. In this step you could adjust the sudoers file to the same permission as the the file /etc/sudoers (440), too.

diff --git a/PKGBUILD b/PKGBUILD
index 399e63f..252722a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -80,7 +80,8 @@ package() {
   # taken from upstream's contrib/rpm directory
   install -vDm644 systemd.service "$pkgdir/usr/lib/systemd/system/$pkgname.service"
   install -vDm644 sysusers.conf "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
-  install -vDm644 sudoers.conf "$pkgdir/etc/sudoers.d/$pkgname"
+  install -vdm750 "$pkgdir/etc/sudoers.d"
+  install -vm440 sudoers.conf "$pkgdir/etc/sudoers.d/$pkgname"
   install -vDm644 config.yml "$pkgdir/etc/prometheus/${pkgname#prometheus-}.yml"
   install -vDm644 config.env "${pkgdir}/etc/prometheus/${pkgname#prometheus-}.env"
Edited by Detlev Brodowski