[Pkg-nagios-changes] [pkg-nagvis] 02/04: Moved permissions to postinst, this fixes problems on update
Markus Frosch
lazyfrosch-guest at moszumanska.debian.org
Thu Dec 19 21:07:26 UTC 2013
This is an automated email from the git hooks/post-receive script.
lazyfrosch-guest pushed a commit to branch master
in repository pkg-nagvis.
commit 09298c961e69a75e4d9ce8088c7efd86ae8cc28e
Author: Markus Frosch <markus at lazyfrosch.de>
Date: Thu Dec 19 21:31:14 2013 +0100
Moved permissions to postinst, this fixes problems on update
Closes: #719698
---
debian/nagvis.postinst | 32 ++++++++++++++++++++++++++++++++
debian/rules | 12 ------------
2 files changed, 32 insertions(+), 12 deletions(-)
diff --git a/debian/nagvis.postinst b/debian/nagvis.postinst
index 696195a..bdfbe5d 100644
--- a/debian/nagvis.postinst
+++ b/debian/nagvis.postinst
@@ -38,6 +38,36 @@ if dpkg --compare-versions "$2" lt-nl "1:1.7.9+dfsg1-1~"; then
rmdir /etc/nagvis/automaps/ 2>/dev/null || true
fi
+setperm() {
+ user="$1"
+ group="$2"
+ mode="$3"
+ 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
+}
+
+update_permissions() {
+ setperm www-data www-data 0755 /etc/nagvis
+ setperm www-data www-data 0755 /etc/nagvis/maps
+ setperm www-data www-data 0755 /etc/nagvis/conf.d
+ setperm www-data www-data 0755 /etc/nagvis/profiles
+
+ setperm www-data www-data 0750 /var/cache/nagvis
+
+ setperm www-data www-data 0755 /var/cache/nagvis/userfiles
+ setperm www-data www-data 0755 /var/cache/nagvis/userfiles/images/maps
+ setperm www-data www-data 0755 /var/cache/nagvis/userfiles/images/shapes
+
+ setperm www-data www-data 0750 /var/cache/nagvis/tmpl
+ setperm www-data www-data 0750 /var/cache/nagvis/tmpl/compile
+ setperm www-data www-data 0750 /var/cache/nagvis/tmpl/cache
+}
+
case "$1" in
configure)
# Source debconf library.
@@ -141,6 +171,8 @@ case "$1" in
fi
fi
+
+ update_permissions
;;
abort-upgrade|abort-remove|abort-deconfigure)
diff --git a/debian/rules b/debian/rules
index 15e8fba..a8d63c9 100755
--- a/debian/rules
+++ b/debian/rules
@@ -26,12 +26,6 @@ override_dh_install:
rm -rf debian/nagvis/usr/share/nagvis/share/userfiles/
# We use the external php-gettext lib to avoid copy copies
rm -rf debian/nagvis/usr/share/nagvis/share/server/core/ext/php-gettext-1.0.9
- # correct directory permissions
- chown www-data:www-data debian/nagvis/etc/nagvis
- chown -R www-data:www-data debian/nagvis/etc/nagvis/maps
- chown -R www-data:www-data debian/nagvis/etc/nagvis/conf.d
- chown -R www-data:www-data debian/nagvis/etc/nagvis/profiles
- chown -R www-data:www-data debian/nagvis/var/cache/nagvis
# Fixing some lintian issues
rm -f debian/nagvis/usr/share/nagvis/share/frontend/nagvis-js/ext/dwoo-1.1.0/LICENSE
find debian/nagvis/ -name ".gitignore" -delete
@@ -40,12 +34,6 @@ override_dh_install:
rm -f debian/nagvis/etc/nagvis/apache2-nagvis.conf-sample
rm -f debian/nagvis/etc/nagvis/nagvis.ini.php-sample
-
-
-override_dh_fixperms:
- dh_fixperms -X /var/cache/nagvis -X /etc/nagvis -X /var/lib/nagvis/userfiles/images
-
-
override_dh_clean:
dh_clean
debconf-updatepo
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-nagvis.git
More information about the Pkg-nagios-changes
mailing list