[pkg-nagios-changes] [Git][nagios-team/pkg-icinga2][master] 2 commits: Set additional permissions in icinga2-common.postinst. (closes: #953425)

Bas Couwenberg gitlab at salsa.debian.org
Mon Mar 9 18:34:16 GMT 2020



Bas Couwenberg pushed to branch master at Debian Nagios Maintainer Group / pkg-icinga2


Commits:
9729902a by Bas Couwenberg at 2020-03-09T18:46:48+01:00
Set additional permissions in icinga2-common.postinst. (closes: #953425)

- - - - -
683a2536 by Bas Couwenberg at 2020-03-09T19:12:29+01:00
Set distribution to unstable.

- - - - -


2 changed files:

- debian/changelog
- debian/icinga2-common.postinst


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+icinga2 (2.11.3-2) unstable; urgency=medium
+
+  * Team upload.
+  * Set additional permissions in icinga2-common.postinst.
+    (closes: #953425)
+
+ -- Bas Couwenberg <sebastic at debian.org>  Mon, 09 Mar 2020 18:46:51 +0100
+
 icinga2 (2.11.3-1) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/icinga2-common.postinst
=====================================
@@ -4,6 +4,11 @@
 set -e
 
 setperm() {
+    ownopt=
+    if [ "$1" = -R ]; then
+        ownopt="-R"
+        shift
+    fi
     user="$1"
     group="$2"
     mode="$3"
@@ -11,7 +16,7 @@ setperm() {
     shift 4
     # only do something when no setting exists
     if ! dpkg-statoverride --list "$file" >/dev/null 2>&1; then
-      chown "$user":"$group" "$file"
+      chown $ownopt "$user":"$group" "$file"
       chmod "$mode" "$file"
     fi
 }
@@ -34,9 +39,17 @@ case "$1" in
 
         # explicitly set permissions on some files that are dependent
         # on the uid/gid of the nagios user, which is dynamically created.
-        setperm nagios nagios 0750 /etc/icinga2
-        setperm nagios nagios 0750 /etc/icinga2/features-enabled
-        setperm nagios nagios 0700 /etc/icinga2/pki
+        if ! dpkg-statoverride --list /etc/icinga2; then
+            setperm nagios nagios 0750 /etc/icinga2
+            setperm nagios nagios 0640 /etc/icinga2/icinga2.conf
+            setperm nagios nagios 0640 /etc/icinga2/constants.conf
+            setperm nagios nagios 0640 /etc/icinga2/zones.conf
+            setperm -R nagios nagios 0700 /etc/icinga2/pki
+            setperm -R nagios nagios 0750 /etc/icinga2/conf.d
+            setperm -R nagios nagios 0750 /etc/icinga2/features-enabled
+            setperm -R nagios nagios 0750 /etc/icinga2/features-available
+            setperm nagios nagios 0750 /etc/icinga2/zones.d
+        fi
 
         setperm nagios adm 2751 /var/log/icinga2
         setperm nagios adm 2751 /var/log/icinga2/compat



View it on GitLab: https://salsa.debian.org/nagios-team/pkg-icinga2/-/compare/209b292e5921294efffe61012408cf57a886206b...683a2536f9bcac8263c53d58819e9a13cd25a9be

-- 
View it on GitLab: https://salsa.debian.org/nagios-team/pkg-icinga2/-/compare/209b292e5921294efffe61012408cf57a886206b...683a2536f9bcac8263c53d58819e9a13cd25a9be
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-nagios-changes/attachments/20200309/1defa99a/attachment-0001.html>


More information about the pkg-nagios-changes mailing list