[debian-edu-commits] debian-edu/pkg-team/ 04/07: Add new stable-zone-ordering.patch to sort zone file output to get stable output (Closes: #710222).
Petter Reinholdtsen
pere at moszumanska.debian.org
Wed Oct 1 05:29:38 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 416e2a136edbbde1563da632b675177b7946636a
Author: Petter Reinholdtsen <pere at hungry.com>
Date: Wed Oct 1 07:02:06 2014 +0200
Add new stable-zone-ordering.patch to sort zone file output to get
stable output (Closes: #710222).
---
debian/patches/series | 1 +
debian/patches/stable-zone-ordering.patch | 60 +++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+)
diff --git a/debian/patches/series b/debian/patches/series
index 0813895..7e6fa25 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ fix-default-location
ldap_host_param
heap-corruption.patch
revert-broken-zones.patch
+stable-zone-ordering.patch
diff --git a/debian/patches/stable-zone-ordering.patch b/debian/patches/stable-zone-ordering.patch
new file mode 100644
index 0000000..0dc43f7
--- /dev/null
+++ b/debian/patches/stable-zone-ordering.patch
@@ -0,0 +1,60 @@
+Description: Make output stable.
+ Make sure the zone ordering is the same every time, no matter what ordering
+ the LDAP server provided. Rewrite the program to keep the "stack" sorted
+ instead of appending LDAP replies to the end.
+Author: Petter Reinholdtsen <pere at hungry.com>
+Bug-Debian: http://bugs.debian.org/710222
+Last-Update: 2014-09-29
+
+Index: ldap2zone-0.2/ldap2zone.c
+===================================================================
+--- ldap2zone-0.2.orig/ldap2zone.c 2014-09-29 23:13:05.359989217 +0200
++++ ldap2zone-0.2/ldap2zone.c 2014-09-29 23:45:48.368033429 +0200
+@@ -39,7 +39,7 @@
+ *stack = item;
+ }
+
+-void assstack_insertbottom(struct assstack_entry **stack, struct assstack_entry *item) {
++void assstack_insertsorted(struct assstack_entry **stack, struct assstack_entry *item) {
+ struct assstack_entry *p;
+
+ item->next = NULL;
+@@ -47,11 +47,17 @@
+ *stack = item;
+ return;
+ }
+- /* find end, should keep track of end somewhere */
+- /* really a queue, not a stack */
++ /* find right place to insert the entry, keeping list sorted with @
++ at the start. */
+ p = *stack;
+- while (p->next)
++ while (p->next &&
++ 0 > strncmp((char*)p->next->key.data, (char*)item->key.data,
++ ( p->next->key.len > item->key.len ?
++ item->key.len : p->key.len) ) ) {
+ p = p->next;
++ }
++
++ item->next = p->next;
+ p->next = item;
+ }
+
+@@ -207,7 +213,7 @@
+ if (name->bv_len == 1 && *(char *)name->bv_val == '@')
+ assstack_push(stack, rr);
+ else
+- assstack_insertbottom(stack, rr);
++ assstack_insertsorted(stack, rr);
+ }
+
+ rrdata = (struct assstack_entry *) malloc(sizeof(struct assstack_entry));
+@@ -240,7 +246,7 @@
+ if (!strcmp(type, "SOA"))
+ assstack_push((struct assstack_entry **) &(rr->val.data), rrdata);
+ else
+- assstack_insertbottom((struct assstack_entry **) &(rr->val.data), rrdata);
++ assstack_insertsorted((struct assstack_entry **) &(rr->val.data), rrdata);
+ return 0;
+ }
+
--
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