[Pkg-nagios-changes] [pkg-nagios3] 02/04: Check for existance of files in setperm()

Alexander Wirt formorer at debian.org
Sun Oct 5 10:13:36 UTC 2014


This is an automated email from the git hooks/post-receive script.

formorer pushed a commit to branch master
in repository pkg-nagios3.

commit 99f6a273982f758a96852799be1926e40c7e0456
Author: Alexander Wirt <formorer at debian.org>
Date:   Sun Oct 5 09:26:32 2014 +0200

    Check for existance of files in setperm()
    
    Closes: #683521
---
 debian/nagios3-cgi.postinst    | 6 ++++--
 debian/nagios3-common.postinst | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/debian/nagios3-cgi.postinst b/debian/nagios3-cgi.postinst
index 856bb33..f9c3e60 100644
--- a/debian/nagios3-cgi.postinst
+++ b/debian/nagios3-cgi.postinst
@@ -27,8 +27,10 @@ setperm() {
     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"
+      if [ -f "$file" ]; then
+        chown "$user":"$group" "$file"
+        chmod "$mode" "$file"
+      fi
     fi
 }
 
diff --git a/debian/nagios3-common.postinst b/debian/nagios3-common.postinst
index 57900ca..f91448c 100644
--- a/debian/nagios3-common.postinst
+++ b/debian/nagios3-common.postinst
@@ -22,8 +22,10 @@ setperm() {
     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"
+      if [ -f "$file" ]; then
+        chown "$user":"$group" "$file"
+        chmod "$mode" "$file"
+      fi
     fi
 }
 

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



More information about the Pkg-nagios-changes mailing list