[debian-edu-commits] debian-edu/pkg-team/ 04/13: Imported Debian patch 0.1-4

Mike Gabriel sunweaver at debian.org
Wed Oct 1 02:59:14 UTC 2014


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

sunweaver pushed a commit to branch master
in repository ldap2bind.

commit 13d714e4a1ef3eba95362d259ddd306fbd5f82d2
Author: Benoit Mortier <benoit.mortier at opensides.be>
Date:   Sun Nov 8 15:27:55 2009 +0100

    Imported Debian patch 0.1-4
---
 changelog                                          |   3 -
 debian/README.source                               |   2 +
 debian/changelog                                   |   6 +
 debian/control                                     |   2 +-
 debian/patches/00list                              |   6 +
 debian/patches/01_makefile.dpatch                  |  19 ++
 debian/patches/02_old_ldap_libs.dpatch             |  34 ++++
 debian/patches/03_original_changelog.dpatch        |  14 ++
 debian/patches/04_add_html_docs.dpatch             | 213 +++++++++++++++++++++
 .../patches/05_correct_bashisms_ldap2bind.dpatch   |  33 ++++
 debian/patches/06_non_correct_zone.dpatch          |  23 +++
 debian/rules                                       |  19 +-
 dnszonehowto.html                                  | 202 -------------------
 ldap2bind                                          |  10 +-
 14 files changed, 367 insertions(+), 219 deletions(-)

diff --git a/changelog b/changelog
deleted file mode 100644
index 80bbfac..0000000
--- a/changelog
+++ /dev/null
@@ -1,3 +0,0 @@
-ldap2zone-0.1 2005-04-24
- This is the very first release and consists of just the file ldap2zone.c
-
diff --git a/debian/README.source b/debian/README.source
new file mode 100644
index 0000000..48b599a
--- /dev/null
+++ b/debian/README.source
@@ -0,0 +1,2 @@
+/usr/share/doc/dpatch/README.source.gz
+
diff --git a/debian/changelog b/debian/changelog
index ebb83d8..f602d65 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ldap2zone (0.1-4) unstable; urgency=low
+
+  * FTBFS with binutils-gold (Closes: #555077)
+
+ -- Benoit Mortier <benoit.mortier at opensides.be>  Sun, 08 Nov 2009 15:27:55 +0100
+
 ldap2zone (0.1-3) unstable; urgency=low
 
   * ldap2bind incorrectly looks for rndc and ldap2zone (Closes: #544855)
diff --git a/debian/control b/debian/control
index 2b3be45..0176fe7 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: GOsa packages maintainers group <gosa-pkg at oss.gonicus.de>
 Uploaders: Cajus Pollmeier <cajus at debian.org>, Benoit Mortier <benoit.mortier at opensides.be>
 Standards-Version: 3.8.3
-Build-Depends: debhelper (>= 5.0.0), libldap2-dev, ldap-utils
+Build-Depends: debhelper (>= 5.0.0), dpatch, libldap2-dev, ldap-utils
 Homepage: https://oss.gonicus.de/labs/gosa
 Vcs-Browser: https://oss.gonicus.de/repositories/goto/trunk/ldap2zone
 Vcs-Svn: https://oss.gonicus.de/repositories/goto/trunk/ldap2zone
diff --git a/debian/patches/00list b/debian/patches/00list
new file mode 100644
index 0000000..f43ebd3
--- /dev/null
+++ b/debian/patches/00list
@@ -0,0 +1,6 @@
+01_makefile
+02_old_ldap_libs
+03_original_changelog
+04_add_html_docs
+05_correct_bashisms_ldap2bind
+06_non_correct_zone
diff --git a/debian/patches/01_makefile.dpatch b/debian/patches/01_makefile.dpatch
new file mode 100644
index 0000000..f3d0124
--- /dev/null
+++ b/debian/patches/01_makefile.dpatch
@@ -0,0 +1,19 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01_makefile.dpatch by  <benoit.mortier at opensides.be>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: added -llber to cope with binutils-gold
+
+ at DPATCH@
+
+--- ldap2zone-0.1/Makefile	2008-10-07 10:21:11.000000000 +0200
++++ ldap2zone/Makefile	2009-11-08 15:16:59.000000000 +0100
+@@ -1,7 +1,7 @@
+ all: ldap2zone
+ 
+ ldap2zone: ldap2zone.c
+-	gcc -Wall ldap2zone.c -o ldap2zone -lldap
++	gcc -Wall ldap2zone.c -o ldap2zone -lldap -llber
+ 
+ install: ldap2zone
+ 	install -d ${DESTDIR}/usr/sbin
diff --git a/debian/patches/02_old_ldap_libs.dpatch b/debian/patches/02_old_ldap_libs.dpatch
new file mode 100644
index 0000000..684aced
--- /dev/null
+++ b/debian/patches/02_old_ldap_libs.dpatch
@@ -0,0 +1,34 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 02_removed old ldap libs.dpatch by  <benoit.mortier at opensides.be>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Removed commented old ldap bindings
+
+ at DPATCH@
+
+--- ldap2zone-0.1/ldap2zone.c	2009-08-12 02:29:59.000000000 +0200
++++ ldap2zone/ldap2zone.c	2009-11-08 15:17:57.000000000 +0100
+@@ -308,7 +308,6 @@
+ 		err(argv[0], "ldap_first_entry() failed");
+ 	    }
+ 	
+-/*	    soavals = ldap_get_values(ld, e, "SOARecord"); */
+ 	    soavals = ldap_get_values_len(ld, e, "SOARecord");
+ 
+ 	    if (soavals)
+@@ -332,7 +331,6 @@
+ 	*s = '\0';
+ 
+ 	if (!strcmp(serial, argv[4])) {
+-/*	    ldap_value_free(soavals); */
+ 	    ldap_value_free_len(soavals);
+ 
+ 	    err(argv[0], "serial numbers match");
+@@ -398,7 +396,6 @@
+ 	if (ptr)
+ 	    ber_free(ptr, 0);
+ 	if (ttlvals)
+-/*	    ldap_value_free(ttlvals); */
+ 	    ldap_value_free_len(ttlvals);
+ 
+ 	ldap_value_free_len(names);
diff --git a/debian/patches/03_original_changelog.dpatch b/debian/patches/03_original_changelog.dpatch
new file mode 100644
index 0000000..8830f3b
--- /dev/null
+++ b/debian/patches/03_original_changelog.dpatch
@@ -0,0 +1,14 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 03_original_changelog.dpatch by  <benoit.mortier at opensides.be>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Add the original changelog
+
+ at DPATCH@
+
+--- ldap2zone-0.1.orig/changelog
++++ ldap2zone-0.1/changelog
+@@ -0,0 +1,3 @@
++ldap2zone-0.1 2005-04-24
++ This is the very first release and consists of just the file ldap2zone.c
++
diff --git a/debian/patches/04_add_html_docs.dpatch b/debian/patches/04_add_html_docs.dpatch
new file mode 100644
index 0000000..84042c8
--- /dev/null
+++ b/debian/patches/04_add_html_docs.dpatch
@@ -0,0 +1,213 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 04_add_html_docs.dpatch by  <benoit.mortier at opensides.be>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Add the html docs
+
+ at DPATCH@
+
+--- ldap2zone-0.1.orig/dnszonehowto.html
++++ ldap2zone-0.1/dnszonehowto.html
+@@ -0,0 +1,202 @@
++<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
++<HEAD>
++<TITLE>How to use dnsZone with the BIND 9 sdb back-end</TITLE>
++</HEAD>
++<BODY>
++<H1>How to use dnsZone with the BIND 9 sdb back-end</H1>
++<H2>Record types</H2>
++The dnsZone class does not contain attributes for all known record types. The
++following types are missing: MF, MB, MG, MR, NULL, WKS, RP, AFSDB, X25, ISDN,
++RT, NSAP, NSAP-PTR, PX and GPOS. Anything defined after this document was
++written is obviously missing. If you want to add some record types that are
++defined by <A href="http://www.iana.org/assignments/dns-parameters">IANA</A>,
++please define it similar to what I've done for the existing ones. The name
++should be <em>{TYPE}Record</em>, and OID should be
++<em>1.3.6.1.4.1.2428.20.1.value</em>. For instance the RR type <em>LOC</em> has
++value <em>29</em>, so attribute name should be <em>LocRecord</em> (casing
++shouldn't matter), and the OID is <em>1.3.6.1.4.1.2428.20.1.29</em>. If you
++follow this, you know that it will be compatible with what I and others
++use, and I guarantee that the OIDs are unique.
++<p>
++The dnsZone class has attributes for some
++basic record types like A, SOA, etc. which are defined in the cosine schema
++and not in this schema. This means that your LDAP server must use both the
++cosine schema and this one. If you're not you should get an error from your
++LDAP server.
++<H2>Example 1</H2>
++Let's look at the following simple zone file.
++<pre>
++@       3600    IN      SOA     ns.my-domain.com. hostmaster.my-domain.com. (
++		                2001030201 3600 1800 604800 86400 )
++		        NS      ns.my-domain.com.
++		        NS      ns.other-domain.com.
++		        MX      10 mail.my-domain.com.
++		        MX      20 mail.other-domain.com.
++
++my-hosta                A       10.10.10.10
++                        MX	10 mail.my-domain.com.
++		        MX      20 mail.other-domain.com.
++www	 1800	 	CNAME	my-hosta.my-domain.com.
++my-hostb 3600           A       10.10.10.11
++                        MX	10 mail.my-domain.com.
++		        MX      20 mail.other-domain.com.
++</pre>
++This can be represented by the following LDIF file:
++<pre>
++dn: relativeDomainName=@, dc=my-domain, dc=com
++objectClass: dNSZone
++relativeDomainName: @
++zoneName: my-domain.com
++dNSTTL: 3600
++dNSClass: IN
++sOARecord: ns.my-domain.com. hostmaster.my-domain.com. 2001030201 3600 1800 604800 86400
++nSRecord: ns.my-domain.com.
++nSRecord: ns.other-domain.com.
++mXRecord: 10 mail.my-domain.com.
++mXRecord: 20 mail.other-domain.com.
++
++dn: relativeDomainName=my-hosta, dc=my-domain, dc=com
++objectClass: dNSZone
++relativeDomainName: my-hosta
++zoneName: my-domain.com
++dNSTTL: 86400
++dNSClass: IN
++aRecord: 10.10.10.10
++mXRecord: 10 mail.my-domain.com.
++mXRecord: 20 mail.other-domain.com.
++
++dn: relativeDomainName=www, dc=my-domain, dc=com
++objectClass: dNSZone
++relativeDomainName: www
++zoneName: my-domain.com
++dNSTTL: 1800
++dNSClass: IN
++cNAMERecord: my-hosta.my-domain.com.
++
++dn: relativeDomainName=my-hostb, dc=my-domain, dc=com
++objectClass: dNSZone
++relativeDomainName: my-hostb
++zoneName: my-domain.com
++dNSTTL: 3600
++dNSClass: IN
++aRecord: 10.10.10.11
++
++dn: relativeDomainName=my-hostb + dNSTTL=86400, dc=my-domain, dc=com
++objectClass: dNSZone
++relativeDomainName: my-hostb
++zoneName: my-domain.com
++dNSTTL: 86400
++dNSClass: IN
++mXRecord: 10 mail.my-domain.com.
++mXRecord: 20 mail.other-domain.com.
++</pre>
++<p>
++zoneName is the name of the zone, i.e. the name of the node in the zone
++that is highest up in the DNS tree. relativeDomainName is the name of
++the nodes relative to this, just like relative names in zone files
++dNSClass is not used by the sdb back-end, so you can leave it out if you
++like. The dNSTTL can also be left out, it will then default to the TTL
++specified in named.conf.
++<p>
++If you want RRs with the same name to have different TTLs (like
++my-hostb in the example), you will have to store it as multiple entries
++all including <em>relativeDomainName=my-hostb</em>. You will need at least as
++many entries as there are different TTLs. The main difficulty is to make
++sure that they all have unique DNs. The way I've chosen is to have a
++multi-valued RDN including dNSTTL, and put all RRs with the same TTL together.
++This is a bit ugly, but I think this is better than having one entry per RR.
++Let me know if you have other ideas.
++<p>
++When storing multiple zones you must make sure of course that the dn's are
++unique. This can easily be done by including the zoneName attribute in the
++DN. This can be done in several ways, one example would be
++<em>relativeDomainName=www, zoneName=my-zone, dc=my-domain, dc=com</em>.
++
++<H2>Example 2</H2>
++The schema is quite flexible as I'll try to show in the next two examples.
++If you have say the same MX records for the three hosts hosta, hostb and
++hostc, you might have one entry for each host and have the same mXRecord
++values in all the entries, or you can have one common entry with the
++mXRecords like this:
++<pre>
++dn: relativeDomainName=hosta, dc=my-domain, dc=com
++objectClass: dNSZone
++relativeDomainName: hosta
++relativeDomainName: hostb
++relativeDomainName: hostc
++zoneName: my-domain.com
++mXRecord: 10 mail.my-domain.com.
++mXRecord: 20 mail.other-domain.com.
++</pre>
++
++<H2>Example 3</H2>
++Assume that we have one web server with one IP address that is a virtual
++web server for hundreds of domains. Rather than having hundreds of similar
++entries, one for each zone, you might do as follows:
++<pre>
++dn: relativeDomainName=www, dc=my-domain, dc=com
++objectClass: dNSZone
++relativeDomainName: www
++zoneName: customerdomain1.com
++zoneName: customerdomain2.com
++...
++zoneName: customerdomain999.com
++aRecord: 10.10.10.10
++mXRecord: 10 mail.my-domain.com.
++mXRecord: 20 mail.other-domain.com.
++</pre>
++If you have a bunch of zones that are identical, except for the zone name,
++you might combine all their entries like above. Sort of like using the same
++zone file for multiple zones.
++
++<H2>Example 4</H2>
++Let's have a look at PTR records for reverse lookups for IPv4 addresses.
++Say you want to have a reverse for the address <em>1.2.3.4</em>. You then
++need a PTR record for <em>4.3.2.1.in-addr.arpa</em>. Using normal zone
++files you would typically have a file for the zone <em>3.2.1.in-addr.arpa</em>
++and inside that put say
++<pre>4 PTR my-hostc.my-domain.com.
++</pre>
++Using this back-end, you change <em>named.conf</em> like above, and use an
++LDAP entry like this:
++<pre>
++dn: relativeDomainName=4, zoneName=3.2.1.in-addr.arpa, dc=my-domain, dc=com
++objectClass: dNSZone
++relativeDomainName: 4
++zoneName: 3.2.1.in-addr.arpa
++pTRRecord: my-hostc.my-domain.com.
++</pre>
++Note that the DN can be whatever you like. If you use a DN like the above,
++you can use <em>zoneName=3.2.1.in-addr.arpa, dc=my-domain, dc=com</em> as
++the search base in the URL in <em>named.conf</em>.
++
++<H2>Example 5</H2>
++As a final example, you might try to search below
++<A href="ldap://ldap.venaas.no/dc=venaas,dc=com,o=DNS,dc=venaas,dc=no">
++ldap://ldap.venaas.no/dc=venaas,dc=com,o=DNS,dc=venaas,dc=no</A>. There
++you will find the zone data for venaas.com.
++You can also browse my directory data using
++<a href="http://sites.inka.de/ms/cgi-bin/web2ldap.fcgi/ldapurl?ldap://garibaldi.venaas.no/dc=venaas,dc=com,o=DNS,dc=venaas,dc=no??sub?(objectclass=*)">web2ldap</a>.
++The master server for
++venaas.com uses this server. The slave uses normal zone transfers.
++
++<H2>Summary</H2>
++As should be evident from the examples, you have great flexibility when
++using this schema with the BIND9 back-end. The tree structure, the dn's,
++doesn't matter at all, the back-end simply does a sub-tree search using
++the base specified in named.conf for all entries in the wanted zone with
++the wanted name. For example when someone tries to look up the node
++<em>my-hosta.my-domain.com</em> it simply does a sub-tree search at the base
++given in <em>named.conf</em> with the filter
++<em>(&(zoneName=my-domain.com)(relativeDomainName=my-hosta))</em>. If someone
++looks up <em>my-domain.com</em> it uses the filter
++<em>(&(zoneName=my-domain.com)(relativeDomainName=@))</em>, and finally if
++someone wants to get the entire zone, for example a secondary using AXFR,
++it uses the filter <em>(zoneName=my-domain.com)</em>. Wildcards are not
++supported.
++<hr>
++<address>
++<a href="mailto:venaas at uninett.no">venaas at uninett.no</a>
++</address>
++Last modified: 2002-02-03
++</BODY>
diff --git a/debian/patches/05_correct_bashisms_ldap2bind.dpatch b/debian/patches/05_correct_bashisms_ldap2bind.dpatch
new file mode 100644
index 0000000..d2eeb2a
--- /dev/null
+++ b/debian/patches/05_correct_bashisms_ldap2bind.dpatch
@@ -0,0 +1,33 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 05_correct_bashisms_ldap2bind.dpatch by  <benoit.mortier at opensides.be>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Correct Bashisms in ldap2bind
+
+ at DPATCH@
+
+--- ldap2zone-0.1.orig/ldap2bind
++++ ldap2zone-0.1/ldap2bind
+@@ -2,7 +2,11 @@
+ 
+ [ -r /etc/default/ldap2zone ] && . /etc/default/ldap2zone
+ 
+-[[ ${LDAP_URI} =~ 'ldap''s'?'://''.'* ]] || LDAP_URI="ldap://${LDAP_URI}"
++case "$LDAP_URI" in 
++ldap://*|ldaps://*) ;; 
++ *) LDAP_URI="ldap://${LDAP_URI}" ;; 
++ esac
++
+ LDAPSEARCH=`which ldapsearch`
+ LDAP_URI_PARAM=${LDAP_URI:+"-H $LDAP_URI"}
+ ALLOW_UPDATE_PARAM=${ALLOW_UPDATE:+"allow-update {$ALLOW_UPDATE};"}
+@@ -53,6 +57,8 @@
+ 
+ 	result=$($rndc reload $domain 2>&1)
+ 	if [ $? -ne 0 ]; then
+-		echo -e "Reloading the zone '$domain' failed:\n$result" 1>&2
++		prinf "Reloading the zone '$domain' failed:\n$result" 1>&2
++	else
++		printf "Reloading the zone '$domain' was successful\n" 1>&2
+ 	fi
+ done
diff --git a/debian/patches/06_non_correct_zone.dpatch b/debian/patches/06_non_correct_zone.dpatch
new file mode 100644
index 0000000..c2197c3
--- /dev/null
+++ b/debian/patches/06_non_correct_zone.dpatch
@@ -0,0 +1,23 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 06_non_correct_zone.dpatch by  <benoit.mortier at opensides.be>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: ldap2zone not creating correctly formatted zone files when dash is used
+
+ at DPATCH@
+
+--- ldap2zone-0.1.orig/ldap2bind
++++ ldap2zone-0.1/ldap2bind
+@@ -5,7 +5,11 @@
+ [[ ${LDAP_URI} =~ 'ldap''s'?'://''.'* ]] || LDAP_URI="ldap://${LDAP_URI}"
+ LDAPSEARCH=`which ldapsearch`
+ LDAP_URI_PARAM=${LDAP_URI:+"-H $LDAP_URI"}
+-ALLOW_UPDATE_PARAM=${ALLOW_UPDATE:+"allow-update {$ALLOW_UPDATE};"}
++
++if [ "$ALLOW_UPDATE" ]; then
++	ALLOW_UPDATE_PARAM="allow-update {$ALLOW_UPDATE}";
++else ALLOW_UPDATE_PARAM=;
++fi
+ 
+ ZONES=`ldapsearch -LLL $LDAP_HOST_PARAM -x "(objectClass=dNSZone)" zoneName | grep zoneName: | sort | uniq | awk '{print $2}'`
+ ldap2zone=`which ldap2zone`
diff --git a/debian/rules b/debian/rules
index 1ded0c4..6d6967f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,17 +3,28 @@
 PACKAGE=ldap2zone
 VERSION=$(shell dpkg-parsechangelog |grep "^Version:" | cut -f2 -d' ')
 
-build: build-stamp
+build: patch build-stamp
 build-stamp:
 	dh_testdir
 	$(MAKE)
 	touch build-stamp
 
-clean:
+clean: clean-patched unpatch
+clean-patched:
 	dh_testdir
+	dh_testroot
 	$(MAKE) clean
 	rm -f build-stamp
-	dh_clean
+#	dh_clean
+
+patch: patch-stamp
+patch-stamp:
+	dpatch apply-all
+	dpatch cat-all >patch-stamp
+
+unpatch:
+	dpatch deapply-all
+	rm -rf patch-stamp debian/patched
 
 install: build
 	dh_testdir
@@ -22,8 +33,6 @@ install: build
 	dh_installdirs
 
 	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
-#	install -d $(CURDIR)/debian/tmp/etc/default
-#	install -m 644 $(CURDIR)/debian/default $(CURDIR)/debian/tmp/etc/default/ldap2zone
 
 binary-arch: build install
 	dh_testdir
diff --git a/dnszonehowto.html b/dnszonehowto.html
deleted file mode 100644
index d15fe08..0000000
--- a/dnszonehowto.html
+++ /dev/null
@@ -1,202 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HEAD>
-<TITLE>How to use dnsZone with the BIND 9 sdb back-end</TITLE>
-</HEAD>
-<BODY>
-<H1>How to use dnsZone with the BIND 9 sdb back-end</H1>
-<H2>Record types</H2>
-The dnsZone class does not contain attributes for all known record types. The
-following types are missing: MF, MB, MG, MR, NULL, WKS, RP, AFSDB, X25, ISDN,
-RT, NSAP, NSAP-PTR, PX and GPOS. Anything defined after this document was
-written is obviously missing. If you want to add some record types that are
-defined by <A href="http://www.iana.org/assignments/dns-parameters">IANA</A>,
-please define it similar to what I've done for the existing ones. The name
-should be <em>{TYPE}Record</em>, and OID should be
-<em>1.3.6.1.4.1.2428.20.1.value</em>. For instance the RR type <em>LOC</em> has
-value <em>29</em>, so attribute name should be <em>LocRecord</em> (casing
-shouldn't matter), and the OID is <em>1.3.6.1.4.1.2428.20.1.29</em>. If you
-follow this, you know that it will be compatible with what I and others
-use, and I guarantee that the OIDs are unique.
-<p>
-The dnsZone class has attributes for some
-basic record types like A, SOA, etc. which are defined in the cosine schema
-and not in this schema. This means that your LDAP server must use both the
-cosine schema and this one. If you're not you should get an error from your
-LDAP server.
-<H2>Example 1</H2>
-Let's look at the following simple zone file.
-<pre>
-@       3600    IN      SOA     ns.my-domain.com. hostmaster.my-domain.com. (
-		                2001030201 3600 1800 604800 86400 )
-		        NS      ns.my-domain.com.
-		        NS      ns.other-domain.com.
-		        MX      10 mail.my-domain.com.
-		        MX      20 mail.other-domain.com.
-
-my-hosta                A       10.10.10.10
-                        MX	10 mail.my-domain.com.
-		        MX      20 mail.other-domain.com.
-www	 1800	 	CNAME	my-hosta.my-domain.com.
-my-hostb 3600           A       10.10.10.11
-                        MX	10 mail.my-domain.com.
-		        MX      20 mail.other-domain.com.
-</pre>
-This can be represented by the following LDIF file:
-<pre>
-dn: relativeDomainName=@, dc=my-domain, dc=com
-objectClass: dNSZone
-relativeDomainName: @
-zoneName: my-domain.com
-dNSTTL: 3600
-dNSClass: IN
-sOARecord: ns.my-domain.com. hostmaster.my-domain.com. 2001030201 3600 1800 604800 86400
-nSRecord: ns.my-domain.com.
-nSRecord: ns.other-domain.com.
-mXRecord: 10 mail.my-domain.com.
-mXRecord: 20 mail.other-domain.com.
-
-dn: relativeDomainName=my-hosta, dc=my-domain, dc=com
-objectClass: dNSZone
-relativeDomainName: my-hosta
-zoneName: my-domain.com
-dNSTTL: 86400
-dNSClass: IN
-aRecord: 10.10.10.10
-mXRecord: 10 mail.my-domain.com.
-mXRecord: 20 mail.other-domain.com.
-
-dn: relativeDomainName=www, dc=my-domain, dc=com
-objectClass: dNSZone
-relativeDomainName: www
-zoneName: my-domain.com
-dNSTTL: 1800
-dNSClass: IN
-cNAMERecord: my-hosta.my-domain.com.
-
-dn: relativeDomainName=my-hostb, dc=my-domain, dc=com
-objectClass: dNSZone
-relativeDomainName: my-hostb
-zoneName: my-domain.com
-dNSTTL: 3600
-dNSClass: IN
-aRecord: 10.10.10.11
-
-dn: relativeDomainName=my-hostb + dNSTTL=86400, dc=my-domain, dc=com
-objectClass: dNSZone
-relativeDomainName: my-hostb
-zoneName: my-domain.com
-dNSTTL: 86400
-dNSClass: IN
-mXRecord: 10 mail.my-domain.com.
-mXRecord: 20 mail.other-domain.com.
-</pre>
-<p>
-zoneName is the name of the zone, i.e. the name of the node in the zone
-that is highest up in the DNS tree. relativeDomainName is the name of
-the nodes relative to this, just like relative names in zone files
-dNSClass is not used by the sdb back-end, so you can leave it out if you
-like. The dNSTTL can also be left out, it will then default to the TTL
-specified in named.conf.
-<p>
-If you want RRs with the same name to have different TTLs (like
-my-hostb in the example), you will have to store it as multiple entries
-all including <em>relativeDomainName=my-hostb</em>. You will need at least as
-many entries as there are different TTLs. The main difficulty is to make
-sure that they all have unique DNs. The way I've chosen is to have a
-multi-valued RDN including dNSTTL, and put all RRs with the same TTL together.
-This is a bit ugly, but I think this is better than having one entry per RR.
-Let me know if you have other ideas.
-<p>
-When storing multiple zones you must make sure of course that the dn's are
-unique. This can easily be done by including the zoneName attribute in the
-DN. This can be done in several ways, one example would be
-<em>relativeDomainName=www, zoneName=my-zone, dc=my-domain, dc=com</em>.
-
-<H2>Example 2</H2>
-The schema is quite flexible as I'll try to show in the next two examples.
-If you have say the same MX records for the three hosts hosta, hostb and
-hostc, you might have one entry for each host and have the same mXRecord
-values in all the entries, or you can have one common entry with the
-mXRecords like this:
-<pre>
-dn: relativeDomainName=hosta, dc=my-domain, dc=com
-objectClass: dNSZone
-relativeDomainName: hosta
-relativeDomainName: hostb
-relativeDomainName: hostc
-zoneName: my-domain.com
-mXRecord: 10 mail.my-domain.com.
-mXRecord: 20 mail.other-domain.com.
-</pre>
-
-<H2>Example 3</H2>
-Assume that we have one web server with one IP address that is a virtual
-web server for hundreds of domains. Rather than having hundreds of similar
-entries, one for each zone, you might do as follows:
-<pre>
-dn: relativeDomainName=www, dc=my-domain, dc=com
-objectClass: dNSZone
-relativeDomainName: www
-zoneName: customerdomain1.com
-zoneName: customerdomain2.com
-...
-zoneName: customerdomain999.com
-aRecord: 10.10.10.10
-mXRecord: 10 mail.my-domain.com.
-mXRecord: 20 mail.other-domain.com.
-</pre>
-If you have a bunch of zones that are identical, except for the zone name,
-you might combine all their entries like above. Sort of like using the same
-zone file for multiple zones.
-
-<H2>Example 4</H2>
-Let's have a look at PTR records for reverse lookups for IPv4 addresses.
-Say you want to have a reverse for the address <em>1.2.3.4</em>. You then
-need a PTR record for <em>4.3.2.1.in-addr.arpa</em>. Using normal zone
-files you would typically have a file for the zone <em>3.2.1.in-addr.arpa</em>
-and inside that put say
-<pre>4 PTR my-hostc.my-domain.com.
-</pre>
-Using this back-end, you change <em>named.conf</em> like above, and use an
-LDAP entry like this:
-<pre>
-dn: relativeDomainName=4, zoneName=3.2.1.in-addr.arpa, dc=my-domain, dc=com
-objectClass: dNSZone
-relativeDomainName: 4
-zoneName: 3.2.1.in-addr.arpa
-pTRRecord: my-hostc.my-domain.com.
-</pre>
-Note that the DN can be whatever you like. If you use a DN like the above,
-you can use <em>zoneName=3.2.1.in-addr.arpa, dc=my-domain, dc=com</em> as
-the search base in the URL in <em>named.conf</em>.
-
-<H2>Example 5</H2>
-As a final example, you might try to search below
-<A href="ldap://ldap.venaas.no/dc=venaas,dc=com,o=DNS,dc=venaas,dc=no">
-ldap://ldap.venaas.no/dc=venaas,dc=com,o=DNS,dc=venaas,dc=no</A>. There
-you will find the zone data for venaas.com.
-You can also browse my directory data using
-<a href="http://sites.inka.de/ms/cgi-bin/web2ldap.fcgi/ldapurl?ldap://garibaldi.venaas.no/dc=venaas,dc=com,o=DNS,dc=venaas,dc=no??sub?(objectclass=*)">web2ldap</a>.
-The master server for
-venaas.com uses this server. The slave uses normal zone transfers.
-
-<H2>Summary</H2>
-As should be evident from the examples, you have great flexibility when
-using this schema with the BIND9 back-end. The tree structure, the dn's,
-doesn't matter at all, the back-end simply does a sub-tree search using
-the base specified in named.conf for all entries in the wanted zone with
-the wanted name. For example when someone tries to look up the node
-<em>my-hosta.my-domain.com</em> it simply does a sub-tree search at the base
-given in <em>named.conf</em> with the filter
-<em>(&(zoneName=my-domain.com)(relativeDomainName=my-hosta))</em>. If someone
-looks up <em>my-domain.com</em> it uses the filter
-<em>(&(zoneName=my-domain.com)(relativeDomainName=@))</em>, and finally if
-someone wants to get the entire zone, for example a secondary using AXFR,
-it uses the filter <em>(zoneName=my-domain.com)</em>. Wildcards are not
-supported.
-<hr>
-<address>
-<a href="mailto:venaas at uninett.no">venaas at uninett.no</a>
-</address>
-Last modified: 2002-02-03
-</BODY>
diff --git a/ldap2bind b/ldap2bind
index 8d577d4..4f84ce7 100755
--- a/ldap2bind
+++ b/ldap2bind
@@ -2,11 +2,7 @@
 
 [ -r /etc/default/ldap2zone ] && . /etc/default/ldap2zone
 
-case "$LDAP_URI" in 
-ldap://*|ldaps://*) ;; 
- *) LDAP_URI="ldap://${LDAP_URI}" ;; 
- esac
-
+[[ ${LDAP_URI} =~ 'ldap''s'?'://''.'* ]] || LDAP_URI="ldap://${LDAP_URI}"
 LDAPSEARCH=`which ldapsearch`
 LDAP_URI_PARAM=${LDAP_URI:+"-H $LDAP_URI"}
 ALLOW_UPDATE_PARAM=${ALLOW_UPDATE:+"allow-update {$ALLOW_UPDATE};"}
@@ -57,8 +53,6 @@ for domain in $ZONES; do
 
 	result=$($rndc reload $domain 2>&1)
 	if [ $? -ne 0 ]; then
-		prinf "Reloading the zone '$domain' failed:\n$result" 1>&2
-	else
-		printf "Reloading the zone '$domain' was successful\n" 1>&2
+		echo -e "Reloading the zone '$domain' failed:\n$result" 1>&2
 	fi
 done

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



More information about the debian-edu-commits mailing list