[Pkg-nagios-changes] [pkg-nagios] r889 - nagios2/trunk/debian
Marc Haber
zugschlus at costa.debian.org
Wed May 3 06:18:20 UTC 2006
Author: zugschlus
Date: 2006-05-03 06:18:19 +0000 (Wed, 03 May 2006)
New Revision: 889
Modified:
nagios2/trunk/debian/changelog
nagios2/trunk/debian/nagios2-common.postinst
nagios2/trunk/debian/nagios2-common.postrm
Log:
* Honor locally set file/dir permissions in postinst, fixing policy
10.9.1 compliance. Thanks to Heiko Schlittermann. (mh) Closes: #361956
Modified: nagios2/trunk/debian/changelog
===================================================================
--- nagios2/trunk/debian/changelog 2006-05-02 14:15:16 UTC (rev 888)
+++ nagios2/trunk/debian/changelog 2006-05-03 06:18:19 UTC (rev 889)
@@ -7,8 +7,10 @@
Thanks to Matt Zagrabelny. (mh) Closes: #360998
* Create pid file directory dynamically in init script.
Thanks to Herbert Straub. (mh) Closes: #361239
+ * Honor locally set file/dir permissions in postinst, fixing policy
+ 10.9.1 compliance. Thanks to Heiko Schlittermann. (mh) Closes: #361956
- -- Marc Haber <mh+debian-packages at zugschlus.de> Tue, 2 May 2006 16:13:25 +0200
+ -- Marc Haber <mh+debian-packages at zugschlus.de> Wed, 3 May 2006 08:13:14 +0200
nagios2 (2.2-1) unstable; urgency=low
Modified: nagios2/trunk/debian/nagios2-common.postinst
===================================================================
--- nagios2/trunk/debian/nagios2-common.postinst 2006-05-02 14:15:16 UTC (rev 888)
+++ nagios2/trunk/debian/nagios2-common.postinst 2006-05-03 06:18:19 UTC (rev 889)
@@ -20,6 +20,19 @@
# location of the default htpasswd authentication file.
htpw=$en/htpasswd.users
+setperm() {
+ local user="$1"
+ local group="$2"
+ local mode="$3"
+ local file="$4"
+ shift 4
+ # only do something when no setting exists
+ if ! dpkg-statoverride --list "$file" >/dev/null 2>&1; then
+ chown "$user":"$group" "$file"
+ chmod "$mode" "$file"
+ fi
+}
+
case "$1" in
configure)
if ! getent passwd nagios > /dev/null ; then
@@ -76,14 +89,12 @@
# explicitly set permissions on some files that are dependent
# on the uid/gid of the nagios user, which is dynamically created.
- chown root:nagios $en/resource.cfg
- chmod 640 $en/resource.cfg
- install -d -onagios -gadm -m2751 /var/log/nagios2
- install -d -onagios -gnagios -m750 /var/run/nagios2
- install -d -onagios -gnagios -m751 /var/lib/nagios2
- # chown instead of install to preserve permission bits
- chown nagios /var/lib/nagios2/rw
- install -d -onagios -gwww-data -m2750 /var/cache/nagios2
+ setperm root nagios 0640 $en/resource.cfg
+ setperm nagios adm 2751 /var/log/nagios2
+ setperm nagios nagios 0750 /var/run/nagios2
+ setperm nagios nagios 0750 /var/lib/nagios2
+ setperm nagios www-data 02750 /var/cache/nagios2
+ setperm nagios www-data 0700 /var/lib/nagios2/rw
# everything went well, so now let's reset the password
db_set nagios2/adminpassword ""
Modified: nagios2/trunk/debian/nagios2-common.postrm
===================================================================
--- nagios2/trunk/debian/nagios2-common.postrm 2006-05-02 14:15:16 UTC (rev 888)
+++ nagios2/trunk/debian/nagios2-common.postrm 2006-05-03 06:18:19 UTC (rev 889)
@@ -1,10 +1,19 @@
#!/bin/sh -e
+# some shorthands for sanity
+en="/etc/nagios2"
+enc="/etc/nagios2/conf.d"
+usn="/usr/share/nagios2"
+
case "$1" in
remove)
;;
purge)
- rm -rf /var/run/nagios2 /var/log/nagios2 /var/lib/nagios2 \
+ for file in $en/resource.cfg /var/log/nagios2 /var/run/nagios2 \
+ /var/lib/nagios2 /var/cache/nagios2 /var/lib/nagios2/rw; do
+ dpkg-statoverride --force --remove $file || true
+ done
+ rm -rf /var/run/nagios2 /var/log/nagios2 /var/lib/nagios2 \
/var/cache/nagios2
rm -f /etc/nagios2/htpasswd.users
rm -f /etc/nagios2/apache2.conf
More information about the Pkg-nagios-changes
mailing list