[debian-edu-commits] debian-edu/pkg-team/ 01/01: Rewrite revert-broken-zones.patch to use named-checkzone to check for invalid zone files, as 'rndc reload' do not seem to return an error code on invalid zone files (Closes: #710362).

Petter Reinholdtsen pere at moszumanska.debian.org
Sat Oct 4 19:30:42 UTC 2014


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

pere pushed a commit to branch master
in repository ldap2zone.

commit 1857ef1c00e651c659fe29a79f957f803b55cd72
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Sat Oct 4 21:30:38 2014 +0200

    Rewrite revert-broken-zones.patch to use named-checkzone to check for invalid zone files, as 'rndc reload' do not seem to return an error code on invalid zone files (Closes: #710362).
---
 debian/changelog                         |  8 ++++++++
 debian/patches/revert-broken-zones.patch | 19 ++++++++++++++-----
 2 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 3c3d2e7..2ea318b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+ldap2zone (0.2-5) UNRELEASED; urgency=low
+
+  * Rewrite revert-broken-zones.patch to use named-checkzone to check
+    for invalid zone files, as 'rndc reload' do not seem to return an
+    error code on invalid zone files (Closes: #710362).
+
+ -- Petter Reinholdtsen <pere at debian.org>  Sat, 04 Oct 2014 21:30:05 +0200
+
 ldap2zone (0.2-4) unstable; urgency=medium
 
   [ Mike Gabriel ]
diff --git a/debian/patches/revert-broken-zones.patch b/debian/patches/revert-broken-zones.patch
index 432e2f8..10437cc 100644
--- a/debian/patches/revert-broken-zones.patch
+++ b/debian/patches/revert-broken-zones.patch
@@ -5,9 +5,11 @@ Author: Petter Reinholdtsen <pere at hungry.com>
 Bug-Debian: http://bugs.debian.org/710362
 Last-Update: 2014-09-30
 
---- ldap2zone-0.2.orig/ldap2bind
-+++ ldap2zone-0.2/ldap2bind
-@@ -78,15 +78,24 @@ EOF
+Index: ldap2zone/ldap2bind
+===================================================================
+--- ldap2zone.orig/ldap2bind	2014-10-04 21:18:02.102641349 +0200
++++ ldap2zone/ldap2bind	2014-10-04 21:22:44.584783512 +0200
+@@ -78,15 +78,31 @@
  fi
  
  for domain in $ZONES; do
@@ -20,8 +22,15 @@ Last-Update: 2014-09-30
 +	if $ldap2zone $domain $LDAP_URI $TTL > $TMPFILE; then
 +		lines=$(cat $TMPFILE | wc -l)
 +		if [ $lines -gt 1 ] ; then
-+		    mv $CURRENT $OLD
-+		    mv $TMPFILE $CURRENT
++		    result=$(named-checkzone $domain $TMPFILE 2>&1)
++		    if [ $? -ne 0 ]; then
++			logger -t ldap2bind "Checking the zone '$domain' failed: $result. Not deploying.\n"
++			rm $TMPFILE
++			continue
++		    else
++			mv $CURRENT $OLD
++			mv $TMPFILE $CURRENT
++		    fi
 +		fi
  	fi
  

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/pkg-team/ldap2zone.git



More information about the debian-edu-commits mailing list