summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Orlitzky <mjo@gentoo.org>2014-10-02 22:22:28 +0000
committerMichael Orlitzky <mjo@gentoo.org>2014-10-02 22:22:28 +0000
commite17c24e56c982484623bea8437b76cdb1367a0f6 (patch)
tree9170f438553176787a7b258f3953d94aed1b6914 /net-dns/djbdns
parentStable for HPPA (bug #524290). (diff)
downloadhistorical-e17c24e56c982484623bea8437b76cdb1367a0f6.tar.gz
historical-e17c24e56c982484623bea8437b76cdb1367a0f6.tar.bz2
historical-e17c24e56c982484623bea8437b76cdb1367a0f6.zip
Revbump to fix bugs #523754 and #523756.
Package-Manager: portage-2.2.8-r2/cvs/Linux x86_64 Manifest-Sign-Key: 0x6F48D3DA05C2DADB!
Diffstat (limited to 'net-dns/djbdns')
-rw-r--r--net-dns/djbdns/ChangeLog8
-rw-r--r--net-dns/djbdns/Manifest33
-rw-r--r--net-dns/djbdns/djbdns-1.05-r30.ebuild153
-rw-r--r--net-dns/djbdns/files/srv_record_support.patch180
4 files changed, 358 insertions, 16 deletions
diff --git a/net-dns/djbdns/ChangeLog b/net-dns/djbdns/ChangeLog
index ce090dfdc2e6..b16fc79987a6 100644
--- a/net-dns/djbdns/ChangeLog
+++ b/net-dns/djbdns/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for net-dns/djbdns
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-dns/djbdns/ChangeLog,v 1.155 2014/10/02 13:01:13 mjo Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dns/djbdns/ChangeLog,v 1.156 2014/10/02 22:22:16 mjo Exp $
+
+*djbdns-1.05-r30 (02 Oct 2014)
+
+ 02 Oct 2014; Michael Orlitzky <mjo@gentoo.org> +djbdns-1.05-r30.ebuild,
+ +files/srv_record_support.patch:
+ Revbump to fix bugs #523754 and #523756.
02 Oct 2014; Michael Orlitzky <mjo@gentoo.org>
-files/CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries-ipv6.patch,
diff --git a/net-dns/djbdns/Manifest b/net-dns/djbdns/Manifest
index 41b6c6345244..1331955893de 100644
--- a/net-dns/djbdns/Manifest
+++ b/net-dns/djbdns/Manifest
@@ -11,29 +11,32 @@ AUX dnsroots.patch 296 SHA256 9fe0552708f6cacd2ace4dca21e3f393acc01e73ac9e2b622a
AUX dnstracesort.patch 327 SHA256 f1d83e1365f68571fa4e007d5219720f8d65eb3730040a087fceb0ce2d8806bf SHA512 ae9cd51f24041aed135b5ba88d1efd0310b8095bccd6fb60a986756b460a4f98a93e163c3ddae7c146d56a9d41778d17449f772b91fdc58d9e69523cf6c2a6e9 WHIRLPOOL 4006c47b039623c8bba8718716a442a3d2dc1705936f83cd1556e4b49cc3de0dc7c6e828e908130bc7584809f551fac68f12f466e21cefd666076db8e63d4399
AUX headtail.patch 1780 SHA256 28ebe521132fe35559273b6542505ab4f0bb7b7ccb88585522e4cc2fe8376dd4 SHA512 0f2625d59f432983ea5c94952957bb08da42ad36dc4c50e0d33ccfe8059f5605650dbb8c22a058b9bd1d75e7032ea5f9ca319a0a2ce5496b1b2129bf9d3f4bdc WHIRLPOOL 400af928a07688b9569e0a71098bdbb18d788c26e8225f4f037ac87cde87f0deb0c8f4f5d9326f4777abca395e8434fc57466df46fe6e3911ba3402e0b5b3ce3
AUX makefile-parallel-test25.patch 2828 SHA256 7fb572ac45d089ddc8a69789c857c13cb84f6a51023544e94459b624282a896b SHA512 0bb89b7141f74906f4bebf5ccc46dad5a4f9147048bfebd78f84a10b0d09f20c75ddb5e935d3e26ba9ce4f51c30270140dd635ab9e8d5ffdfb2aed94399cbe71 WHIRLPOOL 025222dc59da657e87fc9522dcec75f9f35ce405b78e0cd38d96c11470ae36732f1c616c617b63132c4b0ef51b0f5d1b8fd85eb12bb776c8f46000180e2bd104
+AUX srv_record_support.patch 5423 SHA256 0dffcfc7947fd37fba0d62a391d620049bd2845ff35573112c4bb60ffd900782 SHA512 2efedc7c7aaa209bb4a9d65ef1b28934d68c216fd428a27a099ba4801e8be04e1417bdbbf0077088264cd8bc3eb2441855c96890189d8d73804243e6ca4d0851 WHIRLPOOL c8ff0eef4bd77c5f4590c01c19b82277d31b0a7d1689d8952f76425a7027a6b8e9f0b26d413aa1f42be05b518692d531034d901ae6e3e29207f0ca560fcfa05e
AUX string_length_255.patch 299 SHA256 c9b8d0065cfe6d4a9ad460c31c2a75bcce17bfb8001f4448e3464dea07524401 SHA512 b451d23e1a45636dfae7cf69c64e3edde6b655bc0c7407586429e0d8282f17ef6215c6c33a6d238115c39d34fa57fa7699a7a10f146344c677fde10c0e207ac3 WHIRLPOOL 123bdee78c90909936a9af779925cb1da37b83a30e84cad7516f1ca8cf47d9a6445ec39103eb076dc834ec65976004f8bf9aabe63dfffd9604e1b70907c4bcb6
DIST djbdns-1.05-man.tar.gz 17170 SHA256 ba1c58f14bc928908d8618230f400d73cfe2200ed800a272b63048e3e50be569 SHA512 98af7bd9033a2205fbbc0f23b7eab45b9756f6ceff5199a62952e19c89c9fe3c03495cb6f8621d388f883c40650309a1509095417df3f54af21a71350c4aa183 WHIRLPOOL b611e37e7422a4ae405fa15a4b9ff7eb8d0007d81310d044bc1982fe70dada1e4646cf22832e8e5320bae8d2e328eb87d59eb51c3d390f1089f30548053b839b
DIST djbdns-1.05-test25.diff.bz2 20376 SHA256 28c88de08822894cf252e54ed3be9abfdf4f492644ff74a7c479340bdce051ea SHA512 41cca597dba971010b9844071e0349d3a4b25cc4b144e12721b0bc8250589fb374e40ece8908f1081762597048179b1177e88b9a5f97be0b47b63e3183e654bb WHIRLPOOL d531001511ead02f51558909b13e14734f013213e0f13ec7589876878928bd4057f917e004e8d37955c2965aeba5d92a9fc481f2f9ac48c08edaeb9bb9b821d9
+DIST djbdns-1.05-test27.diff.bz2 20695 SHA256 0de38133336016d5a9159d0fe1beaea809e2229820256af114cbf911f04f202a SHA512 e5acf26ff353ae20b6c2186140255bf0ae478a75a9946163d4474a003afbf8c2f47e61a12fc3ed4b9eff17ec8732e9d91bfbb10fb2762310b067180b6d471ba0 WHIRLPOOL 5c89691836a349553531816a8b4c5b6edc18c2c0a1cf8309b67344ad04c9575fbc5f9d79dcf156aeb692ccd7a6fbd2ce2838fb2fd7b85bd6cd0693a9f657e66e
DIST djbdns-1.05.tar.gz 85648 SHA256 3ccd826a02f3cde39be088e1fc6aed9fd57756b8f970de5dc99fcd2d92536b48 SHA512 20f066402801d7bec183cb710a5bc51e41f1410024741e5803e26f68f2c13567e48eba793f233dfab903459c3335bc169e24b99d66a4c64e617e1f0779732fa9 WHIRLPOOL 0fb67d19fcbf1cf21debcedfd3456d9cb9160079631ae1995e94aa9db3969ae02927f215ee8a5f03b34a6523cb9e3abebabf23e08e95eb1efdb626eb8b10312f
EBUILD djbdns-1.05-r29.ebuild 4260 SHA256 60cbd30b862d210f4d5cb3254d36de19093d6a5b70ee4af34f5cff7a64a08f39 SHA512 051cb153f5b98d4dcea5d7e25ab21e7faf7f98ac6141e8c80d997414f82924e1a52cf00d59f1aa723455e20d789e1e8f5ac825cdccd0bf9e960a049efbcfc30c WHIRLPOOL 6f46c42b42ee71f5ab2c5e346d435d6bc2a736adcd9b022fbb7e5e9386be5afe83c02f838d18eeffcb22f1fbfb1d752f5174e13c9d5a76d610d191003db8defa
-MISC ChangeLog 24591 SHA256 bd7cea7ee60d3b23a4237890cb7177badf25f2ab4e7cc2fc1d09c84a0d5e5ea4 SHA512 dc2a8de1fc1dcb81b47f9238591c3f9b4f868cd56f8df555da8ba9b50977f57effc8de820819a6500bb3a1fdf679b2b25ec2e46e6593604e5980f37830f48ded WHIRLPOOL 99609e4a688b4bedaaaf572b6987389cd7620672abe662a22d568f3030c64bf2fd8bc59484867fdcf23165392b19ddf25fce5912f59bd9dfee781a3eeec72e72
+EBUILD djbdns-1.05-r30.ebuild 4429 SHA256 18c1f08b6210049f4b2ae6a0ea821735645e708239c8c0133c40a84b0c486ae4 SHA512 0a5ec7debbc80f07b320d4e54e2d2abb4aba46d129e91c63b40afe0b113af5f62a34bf8273cfab365b6253ddae6c9f5c06aebd06b44ee78ffe7b230947f03017 WHIRLPOOL 7ac326f223871978dcb67c9b51c461645bc49fce426fbacc28d7058b4b50f9babcefa65e2e6da95377d0744c7ce5f711ec67549137d6139348cc20ebb245c955
+MISC ChangeLog 24776 SHA256 2e5692f73564a4c41ff5cec7909f601cb259084420bbb06d751b56d0ece42d7b SHA512 1113945c799edc1e6819b7fe3a6c4f70c86d36de0e2b9d4a47569af43b0eba10157f4e67712753e34e8cc1c3cf572f8c5c530201821ccd5417e2fc61270c6459 WHIRLPOOL 914b3b2c5fa2a9fe56ab07027a80c61ade8a17e3dff08d95877318c449a5efcf3b1c8ac947342cc8b29a93fc16f2a207b4dcb9cee8f98332f4566ac7cbe32c72
MISC metadata.xml 230 SHA256 3e0eae03231007dbb4fe0b289ba7f2bbcae601e58701665162548029933f6be1 SHA512 f0395378896dfdc3161b587248f933ddccfb6e3493a5010b281444b5602a6c6846d0ca618f43a362406ad084e7b479b304291fb122bd87a01173502d03833d70 WHIRLPOOL 24c4a89f282aab3a772a2311806d98ec308a3acea4b56c76cefcdf8ee9cb965c912cbad3a24f0127f8cfcecb4ded0f68ff264caac26a9030857ef1ae4e33356f
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0
-iQJ8BAEBCABmBQJULUygXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
+iQJ8BAEBCABmBQJULdAdXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxNEU5RDcyRDdCMUFGREVGQzBCNDFDMUY2
-RjQ4RDNEQTA1QzJEQURCAAoJEG9I09oFwtrb2joP+QHxRqsn/Z/AA4i5r6Ww3Ufc
-fCWjXyJw6NU3GTjP0TQ/eYHbp+ffLrHnebawTaF3hDOv2DuRJZhWohfwjIrKmV3A
-pyFzmuvPxm8PcyBQrrA5Bz7EPN9XoWdmoANgdSv97vGRzpm5Oc/wem54xsliSH/a
-0JKLdd3ESn5WHWlAsC1FuuZkfeGcLb00ap98LQHfv+qFLldidUZstLjYDAPerMeO
-1/kDWWM1ISi2bIjMMS7kO3LGBW0WWVTATQ/8KFTEFM3a7lmntk+yfioS8AplV8xR
-Zk3eR8WsL3Plxs5hug5HzIkiN1iJHSAFILABaGTxkkNzZKJQJ9x+dpQfFXbKHbrt
-dCpiz7pmEgZo/NXkyYYBR8PDoV+SqNpITAOK7T0J1uKCUagXt+8nXoevoZCL8oF5
-eff9VE8kJgqyr7TmbhJSmt/W6x6qEB6XKG0o5za5ej8zOQ9d/KLRluC9wtuW5QUS
-DQvPxv6SB7eTbq0pKbansArgFueVx6zRRCiHNjBksGkUgmrZ2pbbzj50sVatcClT
-O2sjJOgz5DkmFNShZp5I4WFuvYZjpUTRAunxwy5SsNFpkzp31YLm5Vlf0VrpbE/a
-yf67Dow1ohFLlwcEHXLG6FZNBMdbitNEvwlGn8v5uFT2gv0q32x/z6QSQJ41Anse
-yhexiSqUm8m0j3YgZjzP
-=SuzW
+RjQ4RDNEQTA1QzJEQURCAAoJEG9I09oFwtrbeWIP/A36WVx3ANk3tcJl/D27gwri
+/pFI9baG1GfOOaLLgxKweccx0wnI4dEK+JpHrdiImwM4lPUEiDQ56U0Rrv0tqF+c
+70Pb3JUfVbb0SFk39p6HIOOJ8SEk1ed0ChKu0BjR+Jof+dThpVjO5D/Phb3aYrHp
+kBnaGOokJk8MO5otlEvuA4C/0tgkobZgE6apb1VOnAoOFEbrWzcGd7Q4wH5XOjpd
+B7p1gwIyjyxY3NgH7tb+zSfT6B3zTjBM5ldIDWnBUxbQEodDb55SM1+NGzSgcjJb
+qygxZsZ0P5vcXUJoulZDZ7byFFqXvWfptIJ/MyU9oC3hFQIlHplPgh/X8VbC+dOi
+nM3a9Q7fgIeznbBO9wA2j3Y8tEjPbxsOxLOXSrnLsXnBjn6tfHJPJ5zisxtmE4JB
+ZLzEKPetU6q8RuD7zap1IUxyKX7IAEof4PMYzKC//S4RsPmSJIjE/7PgTRx8Thp1
+91nz5YaGzTnE1BCeSWYVTu8c2G0b+UCuh/5gSQnU0nT123tEC8cdR9nbxjFmGpga
+c5W/RSLRfdq0WEJtuDIq9XOm2kwsjkmf49bpdIDlsmGx2lf7q9UrKrgcL7nK/dAU
+Yozw3y4bKxHui0k7aeplfrTDLdWcAaaexhw3OERvksahK7gCMzVD0CIt9e8WdWr9
+Y3lUU5Bpm2MHGVaQlPqR
+=Q/HU
-----END PGP SIGNATURE-----
diff --git a/net-dns/djbdns/djbdns-1.05-r30.ebuild b/net-dns/djbdns/djbdns-1.05-r30.ebuild
new file mode 100644
index 000000000000..c7b5fadf114c
--- /dev/null
+++ b/net-dns/djbdns/djbdns-1.05-r30.ebuild
@@ -0,0 +1,153 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-dns/djbdns/djbdns-1.05-r30.ebuild,v 1.1 2014/10/02 22:22:16 mjo Exp $
+
+EAPI=5
+inherit eutils flag-o-matic readme.gentoo toolchain-funcs user
+
+DESCRIPTION="Collection of DNS client/server software"
+HOMEPAGE="http://cr.yp.to/djbdns.html"
+IPV6_PATCH="test27"
+
+SRC_URI="http://cr.yp.to/djbdns/${P}.tar.gz
+ http://smarden.org/pape/djb/manpages/${P}-man.tar.gz
+ ipv6? ( http://www.fefe.de/dns/${P}-${IPV6_PATCH}.diff.bz2 )"
+
+SLOT="0"
+LICENSE="public-domain"
+KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="ipv6 selinux"
+
+DEPEND=""
+RDEPEND="sys-apps/ucspi-tcp
+ virtual/daemontools
+ selinux? ( sec-policy/selinux-djbdns )"
+
+src_unpack(){
+ # Unpack both djbdns and its man pages to separate directories.
+ default
+
+ # Now move the man pages under ${S} so that user patches can be
+ # applied to them as well in src_prepare().
+ mv "${PN}-man" "${P}/man" || die "failed to transplant man pages"
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}/headtail.patch" \
+ "${FILESDIR}/dnsroots.patch" \
+ "${FILESDIR}/dnstracesort.patch" \
+ "${FILESDIR}/string_length_255.patch" \
+ "${FILESDIR}/srv_record_support.patch"
+
+ # Fix CVE2009-0858
+ epatch "${FILESDIR}/CVE2009-0858_0001-check-response-domain-name-length.patch"
+
+ if use ipv6; then
+ elog 'At present dnstrace does NOT support IPv6. It will'\
+ 'be compiled without IPv6 support.'
+
+ # Create a separate copy of the source tree for dnstrace.
+ cp -pR "${S}" "${S}-noipv6" || die
+
+ # The big ipv6 patch.
+ epatch "${WORKDIR}/${P}-${IPV6_PATCH}.diff"
+
+ # Fix CVE2008-4392 (ipv6)
+ epatch \
+ "${FILESDIR}/CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries-ipv6-test25.patch" \
+ "${FILESDIR}/CVE2008-4392_0002-dnscache-cache-soa-records-ipv6.patch" \
+ "${FILESDIR}/makefile-parallel-test25.patch"
+
+ cd "${S}-noipv6" || die
+ fi
+
+ # Fix CVE2008-4392 (no ipv6)
+ epatch \
+ "${FILESDIR}/CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries.patch" \
+ "${FILESDIR}/CVE2008-4392_0002-dnscache-cache-soa-records.patch"
+
+ # Later versions of the ipv6 patch include this, but even if
+ # USE=ipv6, we're in the ${S}-noipv6 directory at this point.
+ epatch "${FILESDIR}/${PV}-errno.patch"
+
+ epatch_user
+}
+
+src_compile() {
+ echo "$(tc-getCC) ${CFLAGS}" > conf-cc || die
+ echo "$(tc-getCC) ${LDFLAGS}" > conf-ld || die
+ echo "/usr" > conf-home || die
+ emake
+
+ # If djbdns is compiled with IPv6 support, it breaks dnstrace.
+ # Therefore we must compile dnstrace separately without IPv6
+ # support.
+ if use ipv6; then
+ elog 'Compiling dnstrace without ipv6 support'
+ cp conf-cc conf-ld conf-home "${S}-noipv6/" || die
+ cd "${S}-noipv6" || die
+ emake dnstrace
+ fi
+}
+
+src_install() {
+ insinto /etc
+ doins dnsroots.global
+
+ into /usr
+ dobin *-conf dnscache tinydns walldns rbldns pickdns axfrdns \
+ *-get *-data *-edit dnsip dnsipq dnsname dnstxt dnsmx \
+ dnsfilter random-ip dnsqr dnsq dnstrace dnstracesort
+
+ if use ipv6; then
+ dobin dnsip6 dnsip6q "${S}-noipv6/dnstrace"
+ fi
+
+ dodoc CHANGES README
+
+ doman man/*.[158]
+
+ readme.gentoo_create_doc
+}
+
+pkg_preinst() {
+ # The nofiles group is no longer provided by baselayout.
+ # Share it with qmail if possible.
+ enewgroup nofiles 200
+
+ enewuser dnscache -1 -1 -1 nofiles
+ enewuser dnslog -1 -1 -1 nofiles
+ enewuser tinydns -1 -1 -1 nofiles
+}
+
+DISABLE_AUTOFORMATTING=1
+DOC_CONTENTS='
+The dnscache-setup, tinydns-setup, and djbdns-setup programs have
+been removed to follow upstream more closely. To configure djbdns,
+please follow the instructions at,
+
+ http://cr.yp.to/djbdns.html
+
+Of particular interest are,
+
+ axfrdns : http://cr.yp.to/djbdns/axfrdns-conf.html
+ dnscache: http://cr.yp.to/djbdns/run-cache-x-home.html
+ tinydns : http://cr.yp.to/djbdns/run-server.html
+
+Portage has created users for axfrdns, dnscache, and tinydns; the
+commands to configure these programs are,
+
+ 1. axfrdns-conf tinydns dnslog /var/axfrdns /var/tinydns $ip
+ 2. dnscache-conf dnscache dnslog /var/dnscache $ip
+ 3. tinydns-conf tinydns dnslog /var/tinydns $ip
+
+(replace $ip with the ip address on which the server will run).
+
+If you wish to configure rbldns or walldns, you will need to create
+those users yourself (although you should still use the "dnslog"
+user for the logs):
+
+ 4. rbldns-conf $username dnslog /var/rbldns $ip $base
+ 5. walldns-conf $username dnslog /var/walldns $ip
+'
diff --git a/net-dns/djbdns/files/srv_record_support.patch b/net-dns/djbdns/files/srv_record_support.patch
new file mode 100644
index 000000000000..736884208363
--- /dev/null
+++ b/net-dns/djbdns/files/srv_record_support.patch
@@ -0,0 +1,180 @@
+From: Michael Handler <handler@sub-rosa.com>
+To: dns@list.cr.yp.to
+Subject: tinydns-data SRV & axfr-get SRV/PTR patches
+Date: Thu, 14 Sep 2000 20:37:50 -0400
+
+Here's a combined patch that:
+
+a) adds a native SRV type to tinydns-data
+
+Sfqdn:ip:x:port:weight:priority:ttl:timestamp
+
+Standard rules for ip, x, ttl, and timestamp apply. Port, weight, and
+priority all range from 0-65535. Weight and priority are optional; they
+default to zero if not provided.
+
+Sconsole.zoinks.example.com:1.2.3.4:rack102-con1:2001:69:7:300:
+
+b) makes axfr-get decompose SRV and PTR records and write them out in
+native format, rather than opaque. Again, this is necessary because if the
+DNAME fields in the records reference the same zone as fqdn, they can have
+compression pointers that are bogus outside the context of that specific
+packet, and which can't be correctly loaded into data.cdb by tinydns-data.
+
+--michael
+
+Laurent G. Bercot <ska-djbdns@skarnet.org> updated it for
+djbdns-1.05. Documentation patch by Alex Efros.
+
+diff -rNU3 djbdns-1.05/axfr-get.c djbdns-1.05-srv/axfr-get.c
+--- djbdns-1.05/axfr-get.c Sun Feb 11 22:11:45 2001
++++ djbdns-1.05/axfr-get.c Thu Oct 18 14:46:56 2001
+@@ -209,6 +209,26 @@
+ if (!stralloc_cats(&line,".:")) return 0;
+ if (!stralloc_catulong0(&line,dist,0)) return 0;
+ }
++ else if (byte_equal(data,2,DNS_T_SRV)) {
++ uint16 dist, weight, port;
++ if (!stralloc_copys(&line,"S")) return 0;
++ if (!dns_domain_todot_cat(&line,d1)) return 0;
++ if (!stralloc_cats(&line,"::")) return 0;
++ pos = x_copy(buf,len,pos,data,2);
++ uint16_unpack_big(data,&dist);
++ pos = x_copy(buf,len,pos,data,2);
++ uint16_unpack_big(data,&weight);
++ pos = x_copy(buf,len,pos,data,2);
++ uint16_unpack_big(data,&port);
++ x_getname(buf,len,pos,&d1);
++ if (!dns_domain_todot_cat(&line,d1)) return 0;
++ if (!stralloc_cats(&line,".:")) return 0;
++ if (!stralloc_catulong0(&line,dist,0)) return 0;
++ if (!stralloc_cats(&line,":")) return 0;
++ if (!stralloc_catulong0(&line,weight,0)) return 0;
++ if (!stralloc_cats(&line,":")) return 0;
++ if (!stralloc_catulong0(&line,port,0)) return 0;
++ }
+ else if (byte_equal(data,2,DNS_T_A) && (dlen == 4)) {
+ char ipstr[IP4_FMT];
+ if (!stralloc_copys(&line,"+")) return 0;
+@@ -216,6 +236,14 @@
+ if (!stralloc_cats(&line,":")) return 0;
+ x_copy(buf,len,pos,data,4);
+ if (!stralloc_catb(&line,ipstr,ip4_fmt(ipstr,data))) return 0;
++ }
++ else if (byte_equal(data,2,DNS_T_PTR)) {
++ if (!stralloc_copys(&line,"^")) return 0;
++ if (!dns_domain_todot_cat(&line,d1)) return 0;
++ if (!stralloc_cats(&line,":")) return 0;
++ x_getname(buf,len,pos,&d1);
++ if (!dns_domain_todot_cat(&line,d1)) return 0;
++ if (!stralloc_cats(&line,".")) return 0;
+ }
+ else {
+ unsigned char ch;
+diff -rNU3 djbdns-1.05/dns.h djbdns-1.05-srv/dns.h
+--- djbdns-1.05/dns.h Sun Feb 11 22:11:45 2001
++++ djbdns-1.05/dns.h Thu Oct 18 14:46:56 2001
+@@ -20,6 +20,7 @@
+ #define DNS_T_SIG "\0\30"
+ #define DNS_T_KEY "\0\31"
+ #define DNS_T_AAAA "\0\34"
++#define DNS_T_SRV "\0\41"
+ #define DNS_T_AXFR "\0\374"
+ #define DNS_T_ANY "\0\377"
+
+diff -rNU3 djbdns-1.05/tinydns-data.c djbdns-1.05-srv/tinydns-data.c
+--- djbdns-1.05/tinydns-data.c Sun Feb 11 22:11:45 2001
++++ djbdns-1.05/tinydns-data.c Thu Oct 18 14:50:53 2001
+@@ -196,6 +196,7 @@
+ char type[2];
+ char soa[20];
+ char buf[4];
++ char srv[6];
+
+ umask(022);
+
+@@ -360,6 +361,43 @@
+ rr_start(DNS_T_MX,ttl,ttd,loc);
+ uint16_pack_big(buf,u);
+ rr_add(buf,2);
++ rr_addname(d2);
++ rr_finish(d1);
++
++ if (ip4_scan(f[1].s,ip)) {
++ rr_start(DNS_T_A,ttl,ttd,loc);
++ rr_add(ip,4);
++ rr_finish(d2);
++ }
++ break;
++
++ case 'S':
++ if (!dns_domain_fromdot(&d1,f[0].s,f[0].len)) nomem();
++ if (!stralloc_0(&f[6])) nomem();
++ if (!scan_ulong(f[6].s,&ttl)) ttl = TTL_POSITIVE;
++ ttdparse(&f[7],ttd);
++ locparse(&f[8],loc);
++
++ if (!stralloc_0(&f[1])) nomem();
++
++ if (byte_chr(f[2].s,f[2].len,'.') >= f[2].len) {
++ if (!stralloc_cats(&f[2],".srv.")) nomem();
++ if (!stralloc_catb(&f[2],f[0].s,f[0].len)) nomem();
++ }
++ if (!dns_domain_fromdot(&d2,f[2].s,f[2].len)) nomem();
++
++ if (!stralloc_0(&f[4])) nomem();
++ if (!scan_ulong(f[4].s,&u)) u = 0;
++ uint16_pack_big(srv,u);
++ if (!stralloc_0(&f[5])) nomem();
++ if (!scan_ulong(f[5].s,&u)) u = 0;
++ uint16_pack_big(srv + 2,u);
++ if (!stralloc_0(&f[3])) nomem();
++ if (!scan_ulong(f[3].s,&u)) nomem();
++ uint16_pack_big(srv + 4,u);
++
++ rr_start(DNS_T_SRV,ttl,ttd,loc);
++ rr_add(srv,6);
+ rr_addname(d2);
+ rr_finish(d1);
+
+--- djbdns-1.05/man/tinydns-data.8 2003-10-23 10:47:32.000000000 +0300
++++ djbdns-1.05/man/tinydns-data.8 2014-09-26 02:51:59.861716505 +0300
+@@ -487,6 +487,38 @@
+ .RI \ 072
+ is a colon.
+
++.RI S fqdn\fR:\fIip\fR:\fIx\fR:\fIport\fR:\fIweight\fR:\fIpriority\fR:\fIttl\fR:\fItimestamp\fR:\fIlo\fR
++
++SRV record for
++.IR fqdn .
++
++.B tinydns-data
++creates
++.IP
++an SRV record
++showing
++.IR x\fR.srv.\fIfqdn\fR:\fIport\fR
++as a service for
++.IR fqdn
++with given \fIweight\fR and \fIpriority\fR
++(\fIport\fR, \fIweight\fR and \fIpriority\fR must be in range 0-65535;
++\fIweight\fR and \fIpriority\fR are optional;
++they default to zero if not provided)
++and
++.P
++.IP
++an A record showing
++.I ip
++as the IP address
++of
++.IR x\fR.srv.\fIfqdn .
++.P
++
++If
++.I x
++contains a dot
++then it is treated specially; see above.
++
+ .RI ^ fqdn\fR:\fIp\fR:\fIttl\fR:\fItimestamp\fR:\fIlo\fR
+
+ PTR record for