[Pkg-nagios-changes] [pkg-lconf] 07/09: Added permissions for nagios:nagios to config and tmp directory

Markus Frosch lazyfrosch-guest at alioth.debian.org
Fri Sep 6 14:26:47 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-lconf.

commit 0082eeef4cd9f89a6d73a15dc4928f26e31bd2cd
Author: Markus Frosch <markus at lazyfrosch.de>
Date:   Fri Sep 6 15:59:22 2013 +0200

    Added permissions for nagios:nagios to config and tmp directory
---
 debian/README.Debian |    6 +++++-
 debian/postinst      |   40 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+), 1 deletion(-)

diff --git a/debian/README.Debian b/debian/README.Debian
index f1cb27c..eed9a65 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -4,4 +4,8 @@ lconf for Debian
 Please see /usr/share/doc/lconf/ldap/ for the required LDAP schemas, initial
 LDIF data and some examples.
 
- -- Markus Frosch <markus at lazyfrosch.de>  Fri, 6 Sep 2013 14:07:34 +0200
+Permissions for /etc/lconf/config.pm and /var/cache/lconf/tmp are set to
+root:nagios with 0660 or 0770. Make sure to use dpkg-statoverride when you
+need to change it!
+
+ -- Markus Frosch <markus at lazyfrosch.de>  Fri, 6 Sep 2013 15:50:34 +0200
diff --git a/debian/postinst b/debian/postinst
new file mode 100644
index 0000000..f3ddeb6
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,40 @@
+#!/bin/sh
+# postinst script for lconf
+# see: dh_installdeb(1)
+
+set -e
+
+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
+}
+
+case "$1" in
+    configure)
+        setperm nagios nagios 0640 /etc/lconf/config.pm
+        setperm nagios nagios 0750 /var/cache/lconf/tmp
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-lconf.git



More information about the Pkg-nagios-changes mailing list