[Logcheck-commits] Frédéric Brière : Unconditionally set ownership /permissions on /var/lock/logcheck

Frédéric Brière fbriere-guest at alioth.debian.org
Mon Aug 17 23:26:49 UTC 2009


Module: logcheck
Branch: master
Commit: b0b5808857dd7fe0586b77abbe790e407e0aae27
URL:    http://git.debian.org/?p=logcheck/logcheck.git;a=commit;h=b0b5808857dd7fe0586b77abbe790e407e0aae27

Author: Frédéric Brière <fbriere at fbriere.net>
Date:   Mon Aug 17 19:21:54 2009 -0400

Unconditionally set ownership/permissions on /var/lock/logcheck

Removing (without purging) and re-installing logcheck will result in
/var/lock/logcheck being owned by root.  Since there is no way for a
postinst to know whether the package was previously removed or not, it
must unconditionally set ownership/permissions each time.

---

 debian/changelog         |    2 ++
 debian/logcheck.postinst |   10 +++-------
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 1e3cbaf..71f5e5a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,6 +15,8 @@ logcheck (1.3.4) experimental; urgency=low
   * Updated cron-apt rules to match all possible sizes and lengths
   * Replaced bashisms with POSIX equivalents (closes: #508546)
   * Depend on rsyslog by default (closes: #526911)
+  * Unconditionally set ownership/permissions on /var/lock/logcheck
+    (closes: #515156)
 
  -- Frédéric Brière <fbriere at fbriere.net>  Mon, 17 Aug 2009 11:48:08 -0400
 
diff --git a/debian/logcheck.postinst b/debian/logcheck.postinst
index 4bfa408..6ec240d 100644
--- a/debian/logcheck.postinst
+++ b/debian/logcheck.postinst
@@ -65,11 +65,9 @@ case "$1" in
           cp -p /usr/share/logcheck/header.txt /etc/logcheck
         fi
 
-	# Fix permissions for lock on install or upgrade
-	if [ ! -n "$2" ] || dpkg --compare-versions "$2" lt "1.2.39"; then
-          chown -R logcheck:logcheck /var/lock/logcheck || true
-	  chmod 755 /var/lock/logcheck || true
-        fi
+	# Fix permissions for lock
+        chown -R logcheck:logcheck /var/lock/logcheck || true
+	chmod 755 /var/lock/logcheck || true
 
 	# Unconditionalizing this for now as we have files that are
 	# unreadable upon upgrade.  <ttroxell at debian.org>
@@ -85,8 +83,6 @@ case "$1" in
           chmod 2750 /etc/logcheck/violations.d || true
           chmod 2750 /etc/logcheck/violations.ignore.d || true
     	  chmod -R g+rX /etc/logcheck || true
-          # just in case
-          chown logcheck /var/lock/logcheck > /dev/null || true
 	fi
     	chown -R logcheck:logcheck /var/lib/logcheck || true
     	chmod 0770 /var/lib/logcheck || true




More information about the Logcheck-commits mailing list