Compare commits

...
Sign in to create a new pull request.

170 commits

Author SHA1 Message Date
Fedora Release Engineering
a02ba3bbc5 dist-git conversion 2010-07-28 10:56:49 +00:00
Bill Nottingham
995f6f5cef Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-26 01:20:02 +00:00
Adam Tkac
b8a6936e41 - 9.5.0-P2 release
- bind95-rh450995.patch was merged
- disable transfer stats on DLZ zones (#454783)
2008-08-06 10:01:39 +00:00
Adam Tkac
1a26dc6093 - removed --disable-static configure parameter (distro compatibility) 2008-07-31 14:56:00 +00:00
Adam Tkac
c73a48ceb0 - IP acls weren't merged correctly (#457175) 2008-07-31 14:40:05 +00:00
Adam Tkac
53ae61452e - 9.5.0-P1 release (CVE-2008-1447) 2008-07-08 22:14:22 +00:00
Adam Tkac
64bd596b0b - parse inner acls correctly (#450995) 2008-06-18 11:37:44 +00:00
Adam Tkac
844d808fa8 - 9.5.0 final
- bind-9.5-initialize.patch merged to upstream
2008-05-29 17:58:54 +00:00
Adam Tkac
2b7cae2549 - 9.5.0rc1 release
- initialize memory in ACL code correctly (#446848)
2008-05-22 15:27:32 +00:00
Adam Tkac
2de2c4b95b - 9.5.0b3 release
- dropped patches (upstream)
- bind-9.5.0-generate-xml.patch
- bind-9.5-transfer-segv.patch
- fixed race condition in socket code (#400461, comment #36)
2008-04-28 14:28:01 +00:00
Adam Tkac
e70e236de4 - fixed building of named-sdb (#432497)
- bind-9.3.2-prctl_set_dumpable.patch is obsoleted
2008-04-23 15:03:02 +00:00
Adam Tkac
28d0a5960b - 9.5.0b2
- dropped bind-9.5-gssapi-header.patch (upstream)
- dropped bind-9.5-CVE-2008-0122.patch (upstream)
- improved patch for #400461 (segfault during sending notifies)
2008-02-12 12:58:36 +00:00
Adam Tkac
47d257447e - fixed release 2008-02-04 13:13:03 +00:00
Adam Tkac
4c7234a931 - fixed segfault during sending notifies (#400461) 2008-02-04 13:12:22 +00:00
Adam Tkac
dd31738b4b - CVE-2008-0122 2008-01-21 10:05:57 +00:00
Adam Tkac
3f567ee660 - removed dependency on policycoreutils and libselinux (#426515) 2007-12-27 15:16:08 +00:00
Adam Tkac
db4115971a - fixed initscript wait loop (#426382) 2007-12-27 14:48:08 +00:00
Adam Tkac
d3331f51d6 - added patch 2007-12-20 13:54:26 +00:00
Adam Tkac
2bf8601fe7 - fixed regression caused by libidn2 patch (#426348) 2007-12-20 13:48:07 +00:00
Adam Tkac
ff04c46ad2 - fixed typo in post section (CVE-2007-6283) 2007-12-19 16:29:43 +00:00
Adam Tkac
96141ea48f - CVE-2007-6283 2007-12-19 15:59:19 +00:00
Adam Tkac
affa6523cd - added dst/gssapi.h to -devel subpackage (#419091)
- improved fix for (#417431)
2007-12-12 13:28:21 +00:00
Adam Tkac
4e076eab9f - fixed shutdown with initscript when rndc doesn't work (#417431)
- fixed IDN patch (#412241)
2007-12-11 12:25:40 +00:00
Adam Tkac
0c78489ed4 - 9.5.0b1 (#405281, #392491) 2007-12-06 19:56:23 +00:00
Adam Tkac
2fa9c7ab79 - removed bind-9.5-random_ports.patch because upstream doesn't like it.
query-source{,-v6} is sufficient
- bind-chroot-admin called restorecon on /proc filesystem (#405281)
2007-12-03 14:42:57 +00:00
Adam Tkac
6f0c67cc19 - use system port selector instead ISC's (#391931) 2007-11-21 11:50:12 +00:00
Adam Tkac
c03ad25b44 - removed statement from initscript which passes -D to named 2007-11-19 14:25:07 +00:00
Adam Tkac
a6e7052c19 - 9.5.0a7
- dropped patches (upstream)
- bind-9.5-update.patch
- bind-9.5-pool_badfree.patch
- bind-9.5-_res_errno.patch
2007-11-15 11:51:33 +00:00
Adam Tkac
4bd127caf5 - added forgotten patch :) 2007-11-15 10:51:11 +00:00
Adam Tkac
429d2e2cb5 - added bind-sdb again, contains SDB modules and DLZ modules (#374261)
- bind-9.3.1rc1-sdb.patch replaced by bind-9.5-sdb.patch
2007-11-15 10:50:41 +00:00
Adam Tkac
746204d389 - new L.ROOT-SERVERS.NET address 2007-11-12 16:07:06 +00:00
Adam Tkac
b9a7d34541 - removed Requires: openldap, postgresql, mysql, db4, unixODBC (#374261) 2007-11-12 15:55:18 +00:00
Adam Tkac
6e35d105b5 - completely disable DBUS 2007-10-29 11:22:33 +00:00
Adam Tkac
fd1cdb7f7e typo 2007-10-23 17:52:49 +00:00
Adam Tkac
85fe558d2a - disabled DBUS (dhcdbd doesn't exist & #339191) 2007-10-23 17:51:39 +00:00
Jesse Keating
c914603890 Initialize branch F-8 for bind 2007-10-20 04:30:09 +00:00
Adam Tkac
e57795862b - fixed missing va_end () functions (#336601)
- fixed memory leak when dbus initialization fails
2007-10-18 17:45:07 +00:00
Adam Tkac
38b010cce4 - corrected named.5 SDB statement (#326051) 2007-10-16 16:41:25 +00:00
Ville Skyttä
69c70d5767 b* batch fix for
https://hosted.fedoraproject.org/projects/fedora-infrastructure/ticket/
    42
2007-10-15 17:09:05 +00:00
Adam Tkac
578bd39cd8 - added edns patch again (#275091) 2007-09-24 12:40:31 +00:00
Adam Tkac
4dabfc76b9 - removed bind-9.3.3-edns.patch patch (see #275091 for reasons) 2007-09-24 12:05:29 +00:00
Adam Tkac
0bf924d01d - build with O2
- removed "autotools" patch
- bugfixing in bind-chroot-admin (#279901)
2007-09-20 11:07:30 +00:00
Adam Tkac
fd2022f6be - bind-9.5-2119_revert.patch and bind-9.5-fix_h_errno.patch are obsoleted
by upstream bind-9.5-_res_errno.patch
2007-09-06 11:36:13 +00:00
Adam Tkac
405530db09 - fixed wrong resolver's dispatch pool cleanup (#275011, patch from tmraz
redhat com)
2007-09-06 08:10:34 +00:00
Adam Tkac
90b2384a0c - initscript failure message is now printed correctly (#277981, Quentin
Armitage (quentin armitage org uk) )
2007-09-05 09:56:24 +00:00
Adam Tkac
7fae2eabbc - temporary revert ISC 2119 change and add "libbind-errno" patch (#254501)
again
2007-09-03 08:23:14 +00:00
Štěpán Kasal
8cb3fea2be Fix typo in .cvsignore 2007-08-28 17:55:41 +00:00
Adam Tkac
79505bd352 - removed end dots from Summary sections (skasal@redhat.com)
- fixed wrong file creation by autotools patch (skasal@redhat.com)
2007-08-23 12:57:57 +00:00
Adam Tkac
16d238e0ce - start using --disable-isc-spnego configure option
- remove bind-9.5-spnego-memory_management.patch (source isn't compiled)
2007-08-23 11:11:25 +00:00
Adam Tkac
e4e4554014 - fixed typo 2007-08-23 09:16:40 +00:00
Adam Tkac
45e1c19abb - added new initscript option KEYTAB_FILE which specified where is located
kerberos .keytab file for named service
- obsolete temporary bind-9.5-spnego-memory_management.patch by
    bind-9.5-gssapictx-free.patch which conforms BIND coding standards
    (#251853)
2007-08-23 09:09:35 +00:00
Adam Tkac
14f9d347fa - dropped direct dependency to /etc/openldap/schema directory
- changed hardcoded paths to marcros
- fired away code which configure LDAP server
2007-08-22 11:01:53 +00:00
Adam Tkac
bac865a82b - named could crash with SRV record UPDATE (#251336) 2007-08-14 09:43:25 +00:00
Adam Tkac
aa5064f344 - disable 64bit dlz driver patch on alpha and ia64 (#251298)
- remove wrong malloc functions from lib/dns/spnego.c (#251853)
2007-08-13 16:06:46 +00:00
Adam Tkac
f5a4f24a32 - changed licence to ISC 2007-08-06 09:25:41 +00:00
Adam Tkac
469c27de74 - disabled on all runlevels by default 2007-07-31 13:28:10 +00:00
Adam Tkac
5dbeff85a6 - update autotools tarball 2007-07-30 13:48:23 +00:00
Adam Tkac
81d61cc1b4 - minor next improvements on autotools patch
- dig and host utilities now using libidn instead idnkit for IDN support
2007-07-30 13:34:39 +00:00
Warren Togami
b3eb3fd5ee binutils/gcc bug rebuild (#249435) 2007-07-25 17:37:22 +00:00
Adam Tkac
9b267dcf88 - updated to 9.5.0a6 which contains fixes for CVE-2007-2925 and
CVE-2007-2926
- fixed building on 64bits
2007-07-24 15:18:00 +00:00
Adam Tkac
b479c602ca - integrated "autotools" patch for testing purposes 2007-07-23 17:55:02 +00:00
Adam Tkac
9822d38e59 - fixed DLZ drivers building on 64bit systems 2007-07-23 14:27:48 +00:00
Adam Tkac
42900f10f0 - fixed relation between logrotate and chroot-ed named 2007-07-20 12:53:34 +00:00
Adam Tkac
67199a113c - removed bind-sdb package (default named has compiled SDB backend now)
- integrated DLZ (Dynamically loadable zones) drivers
- integrated GSS-TSIG support (RFC 3645)
- build with -O0 (many new features, potential core dumps will be more
    useful)
2007-07-20 11:31:19 +00:00
Adam Tkac
1bd5800303 initscript is ready for parallel booting (#246878) 2007-07-17 10:48:09 +00:00
Adam Tkac
ad44e317f8 handle integer overflow in isc_time_secondsastimet more gracefully
(#247856)
2007-07-17 06:09:36 +00:00
Adam Tkac
efff370357 - moved chroot's configfiles into chroot subpackage (#248306) 2007-07-16 08:42:55 +00:00
Adam Tkac
efd7ae8a0c - minor changes in default configuration ('pedantic' changes only)
- fix wrong errno assigment in __res_vinit function (#245857)
- removed wrong patch to #150288
2007-07-02 15:31:28 +00:00
Adam Tkac
f8020c403b - typo in post section 2007-06-19 13:12:47 +00:00
Adam Tkac
eaa9b115f4 - updated to latest upstream (9.5.0a5) + remove obsoleted patches 2007-06-19 10:57:53 +00:00
Adam Tkac
ac08c891dd - marked caching-nameserver as obsolete (#244604)
- fixed typo in initscript (causes that named doesn't detect NetworkManager
    correctly)
- next cleanup in configuration - moved configfiles into config.tar
- removed delay between start & restart in initscript
2007-06-18 12:40:28 +00:00
Adam Tkac
466246e734 - major changes in initscript. Could be LSB compatible
- removed caching-nameserver subpackage and move configfiles from there
    into main bind package as default configuration
- major changes in default configuration
2007-06-14 15:13:02 +00:00
Adam Tkac
388af22aff - very minor compatibility change in bind-chroot-admin (line 215)
- enabled IDN support by default and don't distribute IDN libraries
    (#169546)
- specfile cleanup
- add dynamic directory to /var/named. This directory will be primarily
    used for dynamic DNS zones. ENABLE_ZONE_WRITE and SELinux's
    named_write_master_zones no longer exist
2007-06-04 13:44:35 +00:00
Adam Tkac
d96a616c73 - enabled idn by default
- specfile cleanup
2007-06-04 08:05:17 +00:00
Adam Tkac
67f2cfc76b - minor compatibility change in bind-chroot-admin, line 215 2007-05-29 11:39:26 +00:00
Adam Tkac
9fed5d39ed - start using deprecated ldap API because new-api patch didn't work (lack
of documentation)
- fix minor bug in bind-chroot-admin script (#241103)
2007-05-24 14:31:50 +00:00
Adam Tkac
08c420d1f5 - minor correction in ldap-api patch for backward compatibility 2007-05-22 14:49:04 +00:00
Adam Tkac
f80aab5d0a - changed dist flag in changelog to fc8 2007-05-22 14:41:10 +00:00
Adam Tkac
66a96ffe58 - fixed bind-chroot-admin dynamic zone update handling
- rewrited ldap backend to latest api
2007-05-22 14:39:30 +00:00
Adam Tkac
63413d3bfe fixed bind-chroot-admin dynamic DNS handling (#239149) 2007-05-15 12:17:17 +00:00
Adam Tkac
81105946cd test build 2007-05-07 10:23:57 +00:00
Adam Tkac
ad395ca328 updated to 9.4.1 which contains fix to CVE-2007-2241 2007-05-02 14:47:24 +00:00
Adam Tkac
da5c2f58e3 - added forgotten restorecon statement in bind-chroot-admin 2007-04-27 13:59:11 +00:00
Adam Tkac
85a08fc526 - removed -O0 gcc flag 2007-04-27 13:47:51 +00:00
Adam Tkac
f3da66542d - fixed race-condition in dbus code (#235809) 2007-04-27 13:45:53 +00:00
Adam Tkac
9287bb1d6c - cleanup in caching-nameserver config file
- zone-freeze patch has been improved
2007-04-24 11:12:38 +00:00
Adam Tkac
c76ded1aa7 - renamed idn patches
- named could find zone to freeze correctly now (#236426)
2007-04-18 11:25:21 +00:00
Adam Tkac
df3a0fbce4 added experimental idn support to dig + host utils 2007-04-16 14:45:21 +00:00
Adam Tkac
bd74d05ac8 forgot add patch file :) 2007-04-11 15:57:47 +00:00
Adam Tkac
f34e31d03d dnssec-signzone's -d option now works correctly 2007-04-11 15:44:47 +00:00
Adam Tkac
a0b403bf23 release up 2007-04-10 17:26:22 +00:00
Adam Tkac
3baba6556a cleanup in caching-nameserver configuration (#209954) throw away idn
changes
2007-04-10 17:25:42 +00:00
Adam Tkac
c22f9d68e4 see changelog for changes 2007-03-16 15:25:39 +00:00
Adam Tkac
6fba0ee7c4 - bind-chroot-admin is now in chroot package
- SQLite support in bind-sdb
- redhat_doc.patch is always applied
2007-03-12 15:15:37 +00:00
Adam Tkac
6fb096ee7d release number have been corrected 2007-03-06 15:35:07 +00:00
Adam Tkac
cd323ab2e2 changelog update 2007-03-06 15:34:14 +00:00
Adam Tkac
6c28258b0b updated to 9.4.0 bind-chroot-admin now using restorecon instead chcon 2007-03-06 15:32:16 +00:00
Adam Tkac
75ca0205c3 Minor cleanup in bind-chroot-admin script 2007-02-15 15:46:08 +00:00
Adam Tkac
564efa6711 fixed broken bind-chroot-admin script 2007-02-09 14:36:56 +00:00
Adam Tkac
8a78b00ee3 fixed bind-chroot script (#227600) 2007-02-07 16:38:48 +00:00
Adam Tkac
60dfcc10d8 fixed conflict between bind-sdb & ldap 2007-02-05 12:40:39 +00:00
Adam Tkac
4412bf6ac2 {_includedir}/bind macro has been twice in spec file... 2007-02-01 16:09:51 +00:00
Adam Tkac
eafa7dc37d minor errors in specfile have been fixed 2007-02-01 14:06:19 +00:00
Adam Tkac
599083f195 redirected output from bind-chroot's prep & preun to /dev/null 2007-01-29 13:36:51 +00:00
Adam Tkac
7f4f6e8bc3 Updated to 9.3.4 which contains two security bugfixes 2007-01-25 18:00:56 +00:00
Adam Tkac
d2a1789230 added "@" and "." characters to my e-mail address in changelog 2007-01-23 12:45:28 +00:00
Adam Tkac
fa1e5d2f35 marked bind-libbind-devel as obsolete 2007-01-23 10:49:42 +00:00
Adam Tkac
c636daa5c6 fixed some building problems 2007-01-22 13:25:36 +00:00
Adam Tkac
7835aec3b2 Resolves: #214208 Libs from bind-libbind-devel have been moved to
bind-devel & bind-libs
2007-01-22 12:45:50 +00:00
812194c14c fixed a multi-lib issue 2007-01-16 22:42:34 +00:00
ace34f3df1 added namedGetForwarders written in shell (#176100) 2007-01-04 14:37:49 +00:00
98bf92bcec update to 9.3.3 final, fix for #219069: file included twice in src.rpm 2006-12-10 23:52:53 +00:00
291ca3e226 date change 2006-12-06 14:54:45 +00:00
a8feac5391 named.init tunning 2006-12-06 11:37:20 +00:00
d11649f10c added a notice to init script when /etc/named.conf doesn't exist (#216075) 2006-12-06 10:24:21 +00:00
eac33226f7 added fix from #215997: incorrect permissions on dnszone.schema 2006-11-22 14:07:26 +00:00
0d4d38e853 fix for #216185: bind-chroot-admin able to change root mode 750 2006-11-21 16:33:52 +00:00
61a46ae5d2 renamed package, it should meet the N-V-R criteria 2006-11-21 12:39:58 +00:00
5fd50d86bf added back an interval to restart 2006-11-10 14:00:17 +00:00
d4d10768ac fix for #212961: bind-chroot doesn't clean up its mess on %preun 2006-11-03 15:04:41 +00:00
65ae8c598f disabled SSL version check, our SSL is already patched 2006-11-03 11:16:52 +00:00
df7a4dc8d8 update to 9.3.3rc3, removed already merged patches 2006-11-03 10:06:41 +00:00
25f79131ba fix for #211282: EDNS is globally enabled, crashing CheckPoint FW-1 2006-11-02 12:27:31 +00:00
7c45f67d3b added fix for #212549: init script does not unmount /proc filesystem 2006-10-30 13:37:47 +00:00
40d9476882 added fixes for #212348, #211249, #211083 2006-10-30 12:10:16 +00:00
d38c39f8c1 fix for #200465: named-checkzone and co. cannot be run as non-root user 2006-10-26 08:11:06 +00:00
04d663d651 fix for #209359: bind-libs from compatlayer CD will not install on ia64 2006-10-13 10:10:13 +00:00
2c4acd4447 added fix for #210096: warning: group named does not exist - using root 2006-10-10 09:21:35 +00:00
12f7712e23 added timeout to init script 2006-10-05 13:06:25 +00:00
2db6aa0b59 fix for Bind Init Script does not create the PID file always, work in
progress version
2006-10-05 11:14:27 +00:00
c3530fb1c6 removed chcon from post script, replaced by restorecon, (Bug 202547,
comment no. 37)
2006-10-02 13:54:47 +00:00
9c5bac6509 doc fix 2006-09-16 09:38:56 +00:00
714471172a spec file tunning - not complete yet, work in progress 2006-09-15 15:59:29 +00:00
87334e8ec1 modified old patches for D-BUS 2006-09-15 14:46:33 +00:00
bb7424592a we need this one again 2006-09-15 14:45:20 +00:00
c15ebb3e9c update to 9.3.3rc2, removed old/unused patches 2006-09-15 14:44:12 +00:00
8e41396f2b added upstream patch for correct SIG handling - CVE-2006-4095 2006-09-06 12:23:30 +00:00
e927f0202f suppressed messages from bind-chroot-admin, cleared notes about bind-config 2006-09-05 11:03:16 +00:00
dca095b9d3 Fix chcon for SELinux 2006-08-28 14:05:37 +00:00
550ea4cd88 added fix for #203522 - bind-chroot-admin -e command fails 2006-08-22 11:01:33 +00:00
eb803d337a fix for #203194 - tmpfile usage 2006-08-21 10:14:57 +00:00
d215cfc26a dentation fix 2006-08-17 08:43:45 +00:00
d98af728f5 fix for #202542 - /usr/sbin/bind-chroot-admin: No such file or directory,
fix for #202547 - file_contexts: invalid context
2006-08-17 08:40:10 +00:00
eeb13c9f28 added Provides: bind-config 2006-08-11 12:39:51 +00:00
3996b51741 fix bug 197493: renaming subpackage bind-config to caching-nameserver 2006-08-11 09:53:19 +00:00
jvdias
ddffd4665b fix bug 199876 2006-07-24 15:52:39 +00:00
Florian La Roche
07efd33a0c - #195881 2006-07-24 10:01:56 +00:00
jvdias
ba41335b01 fix addenda to bugs 189789, 196398 2006-07-21 20:36:45 +00:00
jvdias
77c3ce0b9c update to auto-enable of D-BUS if NetworkManager enabled 2006-07-20 18:40:14 +00:00
jvdias
6484b68679 fix bugs 196398, 195881; fix namedGetForwarders for new dbus 2006-07-19 19:35:24 +00:00
jvdias
5b2b036577 fix bug 196398; fix namedGetForwarders for new dbus 2006-07-19 18:46:43 +00:00
d9ffd0fde8 Rebuild 2006-07-19 13:51:38 +00:00
jvdias
faad8c0c96 rebuild for new build environment 2006-07-12 21:09:01 +00:00
Jesse Keating
2525a9d6dd bumped for rebuild 2006-07-12 05:26:41 +00:00
jvdias
2746f3de56 fix bugs 191093, 189789; backport selected fixes from upstream v9_3_3b1 CVS 2006-06-14 05:26:43 +00:00
Jeremy Katz
e23cbf6506 - and actually put the devel symlinks in the right subpackage 2006-06-07 21:08:50 +00:00
Jeremy Katz
163a1b1e75 - rebuild for -devel deps 2006-05-25 22:07:07 +00:00
jvdias
3cc598a4bf - apply upstream patch for ncache_adderesult segfault bug 173961 addenda
- fix bug 188382: rpm --verify permissions inconsistencies
- fix bug 189186: use /sbin/service instead of initscript
- rebuild for new gcc, glibc-kernheaders
2006-04-19 00:37:16 +00:00
jvdias
0b3062e363 fix bug 188382; deal with redundant .rpmsave links; prevent redundant
backups
2006-04-19 00:19:58 +00:00
jvdias
bb80172b01 fix bug 188382; deal with redundant .rpmsave links; prevent redundant
backups
2006-04-19 00:15:44 +00:00
jvdias
9d02874931 fix bug 188382; deal with redundant .rpmsave links; prevent redundant
backups
2006-04-18 23:54:14 +00:00
jvdias
1e5053571e fix bug 188382 2006-04-14 01:49:36 +00:00
jvdias
41d052462a - fix resolver.c ncache_adderesult segfault reported in addenda to bug
173961 (upstream bugs #15642, #15528 ?)
- allow named ability to generate core dumps after setuid (upstream bug
    #15753)
2006-04-04 20:55:48 +00:00
jvdias
fb143c82d0 allow named ability to generate core dumps after setuid (upstream bug
#15753)
2006-04-04 20:54:16 +00:00
jvdias
25fb601175 fix bug 187529 2006-04-03 16:45:30 +00:00
jvdias
8d3c0c7318 fix bugs 187286, 187333 2006-03-30 23:37:14 +00:00
jvdias
41272c1807 fix bug 187333 2006-03-30 16:35:58 +00:00
jvdias
431c3f740f *** empty log message *** 2006-03-30 01:04:19 +00:00
jvdias
bc59c3392f fix bug 186577 - libbind.pc, more .spec file cleanup; add sample
configuration files to %doc; rebuild for new gcc and glibc
2006-03-30 00:52:34 +00:00
jvdias
abcbfa4aa4 fix bug 186577 - libbind.pc, more .spec file cleanup; add sample
configuration files to %doc; rebuild for new gcc and glibc
2006-03-30 00:35:52 +00:00
50 changed files with 4252 additions and 2120 deletions

View file

@ -1,12 +0,0 @@
bind-9.2.3rc3-deprecation_msg_shut_up.diff.bz2
bind-9.2.4rc7.tar.gz
bind-chroot.tar.gz
bind-manpages-2.tar.bz2
bind-manpages.patch.bz2
bind-9.2.4rc8.tar.gz
bind-9.3.0.tar.gz
bind-9.3.1rc1.tar.gz
libbind-man.tar.gz
bind-9.3.1.tar.gz
bind-9.3.2rc1.tar.gz
bind-9.3.2.tar.gz

4
.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
bind-9.5.0-P2.tar.gz
config-2.tar
bind-chroot.tar.bz2
libbind-man.tar.gz

View file

@ -1,6 +0,0 @@
# Makefile for source rpm: bind
# $Id$
NAME := bind
SPECFILE = $(firstword $(wildcard *.spec))
include ../common/Makefile.common

View file

@ -1,26 +0,0 @@
--- bind-9.3.1/bin/named_sdb/Makefile.in.dbus_archdep_libdir 2005-08-16 21:23:28.000000000 -0400
+++ bind-9.3.1/bin/named_sdb/Makefile.in 2005-08-16 23:00:49.000000000 -0400
@@ -35,8 +35,9 @@
${LWRES_INCLUDES} ${DNS_INCLUDES} ${BIND9_INCLUDES} \
${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} ${ISC_INCLUDES} \
${DBDRIVER_INCLUDES}
+DBUS_ARCHDEP_LIBDIR ?= lib
DBUS_INCLUDES = \
- -I/usr/lib/dbus-1.0/include -I/usr/include/dbus-1.0
+ -I/usr/${DBUS_ARCHDEP_LIBDIR}/dbus-1.0/include -I/usr/include/dbus-1.0
CDEFINES =
CWARNINGS =
--- bind-9.3.1/bin/named/Makefile.in.dbus_archdep_libdir 2005-08-16 21:23:28.000000000 -0400
+++ bind-9.3.1/bin/named/Makefile.in 2005-08-16 23:00:58.000000000 -0400
@@ -35,8 +35,9 @@
${LWRES_INCLUDES} ${DNS_INCLUDES} ${BIND9_INCLUDES} \
${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} ${ISC_INCLUDES} \
${DBDRIVER_INCLUDES}
+DBUS_ARCHDEP_LIBDIR ?= lib
DBUS_INCLUDES = \
- -I/usr/lib/dbus-1.0/include -I/usr/include/dbus-1.0
+ -I/usr/${DBUS_ARCHDEP_LIBDIR}/dbus-1.0/include -I/usr/include/dbus-1.0
CDEFINES =
CWARNINGS =

View file

@ -1,78 +0,0 @@
--- bind-9.3.1/bin/named/named.8.redhat_doc 2004-06-03 01:35:47.000000000 -0400
+++ bind-9.3.1/bin/named/named.8 2005-05-17 21:22:25.000000000 -0400
@@ -164,6 +164,75 @@
.TP
\fB\fI/var/run/named.pid\fB\fR
The default process-id file.
+.PP
+.SH "NOTES"
+.PP
+.TP
+\fBRed Hat SELinux BIND Security Profile:\fR
+.PP
+By default, Red Hat ships BIND with the most secure SELinux policy
+that will not prevent normal BIND operation and will prevent exploitation
+of all known BIND security vulnerabilities . See the selinux(8) man page
+for information about SElinux.
+.PP
+It is not necessary to run named in a chroot environment if the Red Hat
+SELinux policy for named is enabled. When enabled, this policy is far
+more secure than a chroot environment. Users are recommended to enable
+SELinux and remove the bind-chroot package.
+.PP
+With this extra security comes some restrictions:
+.PP
+By default, the SELinux policy does not allow named to write any master
+zone database files. Only the root user may create files in the $ROOTDIR/var/named
+zone database file directory (the options { "directory" } option), where
+$ROOTDIR is set in /etc/sysconfig/named.
+.PP
+The "named" group must be granted read privelege to
+these files in order for named to be enabled to read them.
+.PP
+Any file created in the zone database file directory is automatically assigned
+the SELinux file context named_zone_t .
+.PP
+By default, SELinux prevents any role from modifying named_zone_t files; this
+means that files in the zone database directory cannot be modified by dynamic
+DNS (DDNS) updates or zone transfers.
+.PP
+The Red Hat BIND distribution and SELinux policy creates two directories where
+named is allowed to create and modify files: $ROOTDIR/var/named/slaves and
+$ROOTDIR/var/named/data. By placing files you want named to modify, such as
+slave or DDNS updateable zone files and database / statistics dump files in
+these directories, named will work normally and no further operator action is
+required. Files in these directories are automatically assigned the 'named_cache_t'
+file context, which SELinux allows named to write.
+.PP
+You can enable the named_t domain to write and create named_zone_t files by use
+of the SELinux tunable boolean variable "named_write_master_zones", using the
+setsebool(8) command or the system-config-security GUI . If you do this, you
+must also set the ENABLE_ZONE_WRITE variable in /etc/sysconfig/named to
+1 / yes to set the ownership of files in the $ROOTDIR/var/named directory
+to named:named in order for named to be allowed to write them.
+.PP
+\fBRed Hat BIND named_sdb SDB support:\fR
+.PP
+Red Hat ships the bind-sdb RPM that provides the /usr/sbin/named_sdb program,
+which is named compiled with the Simplified Database Backend modules that ISC
+provides in the "contrib/sdb" directory.
+.PP
+The SDB modules for LDAP, PostGreSQL and DirDB are compiled into named_sdb.
+.PP
+To run named_sdb, set the ENABLE_SDB variable in /etc/sysconfig/named to 1 or "yes",
+and then the "service named start" named initscript will run named_sdb instead
+of named .
+.PP
+See the documentation for the various SDB modules in /usr/share/doc/bind-sdb-*/ .
+.br
+.PP
+\fBRed Hat system-config-bind:\fR
+.PP
+Red Hat provides the system-config-bind GUI to configure named.conf and zone
+database files. Run the "system-config-bind" command and access the manual
+by selecting the Help menu.
+.PP
.SH "SEE ALSO"
.PP
\fIRFC 1033\fR,

View file

@ -1,85 +0,0 @@
--- bind-9.3.1/bin/named_sdb/Makefile.in.sdb_dbus 2005-08-16 21:18:06.000000000 -0400
+++ bind-9.3.1/bin/named_sdb/Makefile.in 2005-08-16 21:18:06.000000000 -0400
@@ -35,7 +35,8 @@
${LWRES_INCLUDES} ${DNS_INCLUDES} ${BIND9_INCLUDES} \
${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} ${ISC_INCLUDES} \
${DBDRIVER_INCLUDES}
-
+DBUS_INCLUDES = \
+ -I/usr/lib/dbus-1.0/include -I/usr/include/dbus-1.0
CDEFINES =
CWARNINGS =
@@ -52,6 +53,7 @@
ISCDEPLIBS = ../../lib/isc/libisc.@A@
LWRESDEPLIBS = ../../lib/lwres/liblwres.@A@
BIND9DEPLIBS = ../../lib/bind9/libbind9.@A@
+DBUSLIBS= -ldbus-1
DEPLIBS = ${LWRESDEPLIBS} ${DNSDEPLIBS} ${BIND9DEPLIBS} \
${ISCCFGDEPLIBS} ${ISCCCDEPLIBS} ${ISCDEPLIBS}
@@ -70,7 +72,8 @@
tkeyconf.o tsigconf.o update.o xfrout.o \
zoneconf.o \
lwaddr.o lwresd.o lwdclient.o lwderror.o lwdgabn.o \
- lwdgnba.o lwdgrbn.o lwdnoop.o lwsearch.o \
+ lwdgnba.o lwdgrbn.o lwdnoop.o lwsearch.o \
+ dbus_service.o dbus_mgr.o \
$(DBDRIVER_OBJS)
UOBJS = unix/os.o
@@ -83,6 +86,7 @@
zoneconf.c \
lwaddr.c lwresd.c lwdclient.c lwderror.c lwdgabn.c \
lwdgnba.c lwdgrbn.c lwdnoop.c lwsearch.c \
+ dbus_service.c dbus_mgr.c \
$(DBDRIVER_SRCS)
MANPAGES = named.8 lwresd.8 named.conf.5
@@ -114,9 +118,14 @@
-DNS_LOCALSTATEDIR=\"${localstatedir}\" \
-c ${srcdir}/config.c
+dbus_service.o: dbus_service.c
+ ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
+ ${DBUS_INCLUDES} \
+ -c ${srcdir}/dbus_service.c
+
named_sdb@EXEEXT@: ${OBJS} ${UOBJS} ${DEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
- ${OBJS} ${UOBJS} ${LIBS}
+ ${OBJS} ${UOBJS} ${LIBS} ${DBUSLIBS}
doc man:: ${MANOBJS}
--- bind-9.3.1/bin/named_sdb/main.c.sdb_dbus 2005-08-16 21:18:06.000000000 -0400
+++ bind-9.3.1/bin/named_sdb/main.c 2005-08-16 21:21:40.000000000 -0400
@@ -243,7 +243,8 @@
"usage: named [-4|-6] [-c conffile] [-d debuglevel] "
"[-f|-g] [-n number_of_cpus]\n"
" [-p port] [-s] [-t chrootdir] [-u username]\n"
- " [-m {usage|trace|record}]\n");
+ " [-m {usage|trace|record}]\n"
+ " [-D ]\n");
}
static void
@@ -349,7 +350,7 @@
isc_commandline_errprint = ISC_FALSE;
while ((ch = isc_commandline_parse(argc, argv,
- "46c:C:d:fgi:lm:n:N:p:P:st:u:vx:")) != -1) {
+ "46c:C:d:fgi:lm:n:N:p:P:st:u:vx:D")) != -1) {
switch (ch) {
case '4':
if (disable4)
@@ -438,6 +439,9 @@
case 'v':
printf("BIND %s\n", ns_g_version);
exit(0);
+ case 'D':
+ ns_g_dbus = 1;
+ break;
case '?':
usage();
ns_main_earlyfatal("unknown option '-%c'",

View file

@ -1,27 +0,0 @@
--- bind-9.3.1beta2/configure.in.openssl_suffix 2004-12-08 23:07:10.000000000 -0500
+++ bind-9.3.1beta2/configure.in 2005-01-27 17:03:49.394814000 -0500
@@ -374,6 +374,10 @@
fi
done
fi
+OSSUFFIX=
+if test "$host_cpu" = "x86_64"; then
+ OSSUFFIX=64
+fi;
case "$use_openssl" in
no)
AC_MSG_RESULT(no)
@@ -416,11 +420,11 @@
DNS_OPENSSL_LIBS="-L$use_openssl/lib -R$use_openssl/lib -lcrypto"
;;
*)
- DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
+ DNS_OPENSSL_LIBS="-L$use_openssl/lib${OSUFFIX} -lcrypto"
;;
esac
fi
- AC_MSG_RESULT(using openssl from $use_openssl/lib and $use_openssl/include)
+ AC_MSG_RESULT(using openssl from $use_openssl/lib${OSSUFFIX} and $use_openssl/include)
saved_cflags="$CFLAGS"
saved_libs="$LIBS"

View file

@ -1,170 +0,0 @@
--- bind-9.3.1rc1/configure.in.sdb 2005-02-16 22:25:08.000000000 -0500
+++ bind-9.3.1rc1/configure.in 2005-02-16 22:25:08.000000000 -0500
@@ -2194,6 +2194,8 @@
bin/check/Makefile
bin/named/Makefile
bin/named/unix/Makefile
+ bin/named_sdb/Makefile
+ bin/named_sdb/unix/Makefile
bin/rndc/Makefile
bin/rndc/unix/Makefile
bin/dig/Makefile
@@ -2215,6 +2217,7 @@
bin/tests/system/tkey/Makefile
bin/tests/headerdep_test.sh
bin/dnssec/Makefile
+ bin/sdb_tools/Makefile
doc/Makefile
doc/arm/Makefile
doc/arm/nominum-docbook-html.dsl
--- bind-9.3.1rc1/bin/named_sdb/main.c.sdb 2004-10-24 20:42:54.000000000 -0400
+++ bind-9.3.1rc1/bin/named_sdb/main.c 2005-02-16 22:25:08.000000000 -0500
@@ -71,6 +71,9 @@
* Include header files for database drivers here.
*/
/* #include "xxdb.h" */
+#include "ldapdb.h"
+#include "pgsqldb.h"
+#include "dirdb.h"
static isc_boolean_t want_stats = ISC_FALSE;
static char program_name[ISC_DIR_NAMEMAX] = "named";
@@ -656,7 +659,57 @@
* Add calls to register sdb drivers here.
*/
/* xxdb_init(); */
-
+ result = ldapdb_init();
+ if (result != ISC_R_SUCCESS)
+ {
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_ERROR,
+ "SDB ldap module initialisation failed: %s.",
+ isc_result_totext(result)
+ );
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_ERROR,
+ "SDB ldap zone database will be unavailable."
+ );
+ }else
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_NOTICE, "SDB ldap zone database module loaded."
+ );
+
+ result = pgsqldb_init();
+ if (result != ISC_R_SUCCESS)
+ {
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_ERROR,
+ "SDB pgsql module initialisation failed: %s.",
+ isc_result_totext(result)
+ );
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_ERROR,
+ "SDB pgsql zone database will be unavailable."
+ );
+ }else
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_NOTICE, "SDB postgreSQL DB zone database module loaded."
+ );
+
+ result = dirdb_init();
+ if (result != ISC_R_SUCCESS)
+ {
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_ERROR,
+ "SDB directory DB module initialisation failed: %s.",
+ isc_result_totext(result)
+ );
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_ERROR,
+ "SDB directory DB zone database will be unavailable."
+ );
+ }else
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_NOTICE, "SDB directory DB zone database module loaded."
+ );
+
ns_server_create(ns_g_mctx, &ns_g_server);
}
@@ -673,6 +726,10 @@
*/
/* xxdb_clear(); */
+ ldapdb_clear();
+ pgsqldb_clear();
+ dirdb_clear();
+
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
ISC_LOG_NOTICE, "exiting");
ns_log_shutdown();
--- bind-9.3.1rc1/bin/named_sdb/Makefile.in.sdb 2005-02-16 22:25:08.000000000 -0500
+++ bind-9.3.1rc1/bin/named_sdb/Makefile.in 2005-02-16 22:25:08.000000000 -0500
@@ -26,10 +26,10 @@
#
# Add database drivers here.
#
-DBDRIVER_OBJS =
-DBDRIVER_SRCS =
+DBDRIVER_OBJS = ldapdb.o pgsqldb.o dirdb.o
+DBDRIVER_SRCS = ldapdb.c pgsqldb.c dirdb.c
DBDRIVER_INCLUDES =
-DBDRIVER_LIBS =
+DBDRIVER_LIBS = -lldap -llber -lpq
CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include \
${LWRES_INCLUDES} ${DNS_INCLUDES} ${BIND9_INCLUDES} \
@@ -61,7 +61,7 @@
SUBDIRS = unix
-TARGETS = named@EXEEXT@ lwresd@EXEEXT@
+TARGETS = named_sdb@EXEEXT@
OBJS = aclconf.o builtin.o client.o config.o control.o \
controlconf.o interfacemgr.o \
@@ -114,14 +114,10 @@
-DNS_LOCALSTATEDIR=\"${localstatedir}\" \
-c ${srcdir}/config.c
-named@EXEEXT@: ${OBJS} ${UOBJS} ${DEPLIBS}
+named_sdb@EXEEXT@: ${OBJS} ${UOBJS} ${DEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
${OBJS} ${UOBJS} ${LIBS}
-lwresd@EXEEXT@: named@EXEEXT@
- rm -f lwresd@EXEEXT@
- @LN@ named@EXEEXT@ lwresd@EXEEXT@
-
doc man:: ${MANOBJS}
docclean manclean maintainer-clean::
@@ -132,13 +128,8 @@
installdirs:
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir}
- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man5
- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
-install:: named@EXEEXT@ lwresd@EXEEXT@ installdirs
- ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named@EXEEXT@ ${DESTDIR}${sbindir}
- (cd ${DESTDIR}${sbindir}; rm -f lwresd@EXEEXT@; @LN@ named@EXEEXT@ lwresd@EXEEXT@)
- ${INSTALL_DATA} ${srcdir}/named.8 ${DESTDIR}${mandir}/man8
- ${INSTALL_DATA} ${srcdir}/lwresd.8 ${DESTDIR}${mandir}/man8
- ${INSTALL_DATA} ${srcdir}/named.conf.5 ${DESTDIR}${mandir}/man5
+install:: named_sdb@EXEEXT@ installdirs
+ ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named_sdb@EXEEXT@ ${DESTDIR}${sbindir}
+
--- bind-9.3.1rc1/bin/Makefile.in.sdb 2004-03-06 05:21:10.000000000 -0500
+++ bind-9.3.1rc1/bin/Makefile.in 2005-02-16 22:25:08.000000000 -0500
@@ -19,7 +19,7 @@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
-SUBDIRS = named rndc dig dnssec tests nsupdate check
+SUBDIRS = named named_sdb rndc dig dnssec tests nsupdate check sdb_tools
TARGETS =
@BIND9_MAKE_RULES@

View file

@ -1,8 +1,8 @@
--- bind-9.3.2/bin/named/named.8.redhat_doc 2005-10-12 22:33:46.000000000 -0400
+++ bind-9.3.2/bin/named/named.8 2006-02-07 15:56:31.000000000 -0500
@@ -169,6 +169,75 @@
.TP
--- bind-9.4.0/bin/named/named.8.redhat_doc 2007-01-30 01:23:44.000000000 +0100
+++ bind-9.4.0/bin/named/named.8 2007-03-12 15:39:19.000000000 +0100
@@ -205,6 +205,63 @@
\fI/var/run/named.pid\fR
.RS 4
The default process\-id file.
+.PP
+.SH "NOTES"
@ -37,32 +37,20 @@
+means that files in the zone database directory cannot be modified by dynamic
+DNS (DDNS) updates or zone transfers.
+.PP
+The Red Hat BIND distribution and SELinux policy creates two directories where
+named is allowed to create and modify files: $ROOTDIR/var/named/slaves and
+$ROOTDIR/var/named/data. By placing files you want named to modify, such as
+The Red Hat BIND distribution and SELinux policy creates three directories where
+named is allowed to create and modify files: /var/named/slaves, /var/named/dynamic
+/var/named/data. By placing files you want named to modify, such as
+slave or DDNS updateable zone files and database / statistics dump files in
+these directories, named will work normally and no further operator action is
+required. Files in these directories are automatically assigned the 'named_cache_t'
+file context, which SELinux allows named to write.
+.PP
+You can enable the named_t domain to write and create named_zone_t files by use
+of the SELinux tunable boolean variable "named_write_master_zones", using the
+setsebool(8) command or the system-config-security GUI . If you do this, you
+must also set the ENABLE_ZONE_WRITE variable in /etc/sysconfig/named to
+1 / yes to set the ownership of files in the $ROOTDIR/var/named directory
+to named:named in order for named to be allowed to write them.
+\fBRed Hat BIND SDB support:\fR
+.PP
+\fBRed Hat BIND named_sdb SDB support:\fR
+Red Hat ships named with compiled in Simplified Database Backend modules that ISC
+provides in the "contrib/sdb" directory. Install bind-sdb package if you want use them
+.PP
+Red Hat ships the bind-sdb RPM that provides the /usr/sbin/named_sdb program,
+which is named compiled with the Simplified Database Backend modules that ISC
+provides in the "contrib/sdb" directory.
+.PP
+The SDB modules for LDAP, PostGreSQL and DirDB are compiled into named_sdb.
+.PP
+To run named_sdb, set the ENABLE_SDB variable in /etc/sysconfig/named to 1 or "yes",
+and then the "service named start" named initscript will run named_sdb instead
+of named .
+The SDB modules for LDAP, PostGreSQL, DirDB and SQLite are compiled into named-sdb.
+.PP
+See the documentation for the various SDB modules in /usr/share/doc/bind-sdb-*/ .
+.br
@ -73,6 +61,6 @@
+database files. Run the "system-config-bind" command and access the manual
+by selecting the Help menu.
+.PP
.RE
.SH "SEE ALSO"
.PP
RFC 1033,

View file

@ -1,6 +1,6 @@
--- bind-9.3.2b1/make/rules.in.PIE 2005-05-12 17:36:17.000000000 -0400
+++ bind-9.3.2b1/make/rules.in 2005-10-06 20:04:36.000000000 -0400
@@ -118,6 +118,9 @@
--- bind-9.4.0/make/rules.in.PIE 2007-01-30 00:57:21.000000000 +0100
+++ bind-9.4.0/make/rules.in 2007-03-06 12:53:37.000000000 +0100
@@ -124,6 +124,9 @@
.c.@O@:
${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} -c $<
@ -10,201 +10,9 @@
SHELL = @SHELL@
LIBTOOL = @LIBTOOL@
LIBTOOL_MODE_COMPILE = ${LIBTOOL} @LIBTOOL_MODE_COMPILE@
--- bind-9.3.2b1/bin/dnssec/Makefile.in.PIE 2005-05-01 20:25:54.000000000 -0400
+++ bind-9.3.2b1/bin/dnssec/Makefile.in 2005-10-06 20:04:36.000000000 -0400
@@ -41,7 +41,7 @@
# Alphabetically
TARGETS = dnssec-keygen@EXEEXT@ dnssec-signzone@EXEEXT@
-OBJS = dnssectool.@O@
+OBJS = dnssectool.o
SRCS = dnssec-keygen.c dnssec-signzone.c dnssectool.c
@@ -51,19 +51,25 @@
MANOBJS = ${MANPAGES} ${HTMLPAGES}
+EXT_CFLAGS = -fPIE
+
@BIND9_MAKE_RULES@
-dnssec-keygen@EXEEXT@: dnssec-keygen.@O@ ${OBJS} ${DEPLIBS}
+LDFLAGS += -pie -Wl,-z,relro,-z,now,-z,nodlopen,-z,noexecstack
+
+.SUFFIXES: .c .o
+
+dnssec-keygen@EXEEXT@: dnssec-keygen.o ${OBJS} ${DEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
- dnssec-keygen.@O@ ${OBJS} ${LIBS}
+ dnssec-keygen.o ${OBJS} ${LIBS}
-dnssec-signzone.@O@: dnssec-signzone.c
- ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} -DVERSION=\"${VERSION}\" \
+dnssec-signzone.o: dnssec-signzone.c
+ ${CC} ${ALL_CFLAGS} -DVERSION=\"${VERSION}\" \
-c ${srcdir}/dnssec-signzone.c
-dnssec-signzone@EXEEXT@: dnssec-signzone.@O@ ${OBJS} ${DEPLIBS}
+dnssec-signzone@EXEEXT@: dnssec-signzone.o ${OBJS} ${DEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
- dnssec-signzone.@O@ ${OBJS} ${LIBS}
+ dnssec-signzone.o ${OBJS} ${LIBS}
doc man:: ${MANOBJS}
--- bind-9.3.2b1/bin/named/Makefile.in.PIE 2004-09-06 17:47:25.000000000 -0400
+++ bind-9.3.2b1/bin/named/Makefile.in 2005-10-06 20:04:36.000000000 -0400
@@ -63,17 +63,17 @@
TARGETS = named@EXEEXT@ lwresd@EXEEXT@
-OBJS = aclconf.@O@ builtin.@O@ client.@O@ config.@O@ control.@O@ \
- controlconf.@O@ interfacemgr.@O@ \
- listenlist.@O@ log.@O@ logconf.@O@ main.@O@ notify.@O@ \
- query.@O@ server.@O@ sortlist.@O@ \
- tkeyconf.@O@ tsigconf.@O@ update.@O@ xfrout.@O@ \
- zoneconf.@O@ \
- lwaddr.@O@ lwresd.@O@ lwdclient.@O@ lwderror.@O@ lwdgabn.@O@ \
- lwdgnba.@O@ lwdgrbn.@O@ lwdnoop.@O@ lwsearch.@O@ \
+OBJS = aclconf.o builtin.o client.o config.o control.o \
+ controlconf.o interfacemgr.o \
+ listenlist.o log.o logconf.o main.o notify.o \
+ query.o server.o sortlist.o \
+ tkeyconf.o tsigconf.o update.o xfrout.o \
+ zoneconf.o \
+ lwaddr.o lwresd.o lwdclient.o lwderror.o lwdgabn.o \
+ lwdgnba.o lwdgrbn.o lwdnoop.o lwsearch.o \
$(DBDRIVER_OBJS)
-UOBJS = unix/os.@O@
+UOBJS = unix/os.o
SRCS = aclconf.c builtin.c client.c config.c control.c \
controlconf.c interfacemgr.c \
@@ -91,16 +91,22 @@
MANOBJS = ${MANPAGES} ${HTMLPAGES}
+EXT_CFLAGS = -fPIE
+
@BIND9_MAKE_RULES@
-main.@O@: main.c
- ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
+LDFLAGS += -pie -Wl,-z,relro,-z,now,-z,nodlopen,-z,noexecstack
+
+.SUFFIXES: .c .o
+
+main.o: main.c
+ ${CC} ${ALL_CFLAGS} \
-DVERSION=\"${VERSION}\" \
-DNS_LOCALSTATEDIR=\"${localstatedir}\" \
-DNS_SYSCONFDIR=\"${sysconfdir}\" -c ${srcdir}/main.c
-config.@O@: config.c
- ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
+config.o: config.c
+ ${CC} ${ALL_CFLAGS} \
-DVERSION=\"${VERSION}\" \
-DNS_LOCALSTATEDIR=\"${localstatedir}\" \
-c ${srcdir}/config.c
--- bind-9.3.2b1/bin/named/unix/Makefile.in.PIE 2004-03-08 04:04:15.000000000 -0500
+++ bind-9.3.2b1/bin/named/unix/Makefile.in 2005-10-06 20:04:36.000000000 -0400
@@ -27,10 +27,14 @@
CDEFINES =
CWARNINGS =
-OBJS = os.@O@
+OBJS = os.o
SRCS = os.c
TARGETS = ${OBJS}
+EXT_CFLAGS = -fPIE
+
@BIND9_MAKE_RULES@
+
+.SUFFIXES: .c .o
\ No newline at end of file
--- bind-9.3.2b1/bin/check/Makefile.in.PIE 2004-07-20 03:01:48.000000000 -0400
+++ bind-9.3.2b1/bin/check/Makefile.in 2005-10-06 20:04:36.000000000 -0400
@@ -55,27 +55,33 @@
MANOBJS = ${MANPAGES} ${HTMLPAGES}
+EXT_CFLAGS = -fPIE
+
@BIND9_MAKE_RULES@
-named-checkconf.@O@: named-checkconf.c
- ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
+LDFLAGS += -pie -Wl,-z,relro,-z,now,-z,nodlopen,-z,noexecstack
+
+.SUFFIXES: .c .o
+
+named-checkconf.o: named-checkconf.c
+ ${CC} ${ALL_CFLAGS} \
-DVERSION=\"${VERSION}\" \
-c ${srcdir}/named-checkconf.c
-named-checkzone.@O@: named-checkzone.c
- ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
+named-checkzone.o: named-checkzone.c
+ ${CC} ${ALL_CFLAGS} \
-DVERSION=\"${VERSION}\" \
-c ${srcdir}/named-checkzone.c
-named-checkconf@EXEEXT@: named-checkconf.@O@ check-tool.@O@ ${ISCDEPLIBS} \
+named-checkconf@EXEEXT@: named-checkconf.o check-tool.o ${ISCDEPLIBS} \
${ISCCFGDEPLIBS} ${BIND9DEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
- named-checkconf.@O@ check-tool.@O@ ${BIND9LIBS} ${ISCCFGLIBS} \
+ named-checkconf.o check-tool.o ${BIND9LIBS} ${ISCCFGLIBS} \
${DNSLIBS} ${ISCLIBS} ${LIBS}
-named-checkzone@EXEEXT@: named-checkzone.@O@ check-tool.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
+named-checkzone@EXEEXT@: named-checkzone.o check-tool.o ${ISCDEPLIBS} ${DNSDEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
- named-checkzone.@O@ check-tool.@O@ ${DNSLIBS} ${ISCLIBS} ${LIBS}
+ named-checkzone.o check-tool.o ${DNSLIBS} ${ISCLIBS} ${LIBS}
doc man:: ${MANOBJS}
--- bind-9.3.2b1/bin/nsupdate/Makefile.in.PIE 2004-07-20 03:01:49.000000000 -0400
+++ bind-9.3.2b1/bin/nsupdate/Makefile.in 2005-10-06 20:04:36.000000000 -0400
@@ -49,7 +49,7 @@
TARGETS = nsupdate@EXEEXT@
-OBJS = nsupdate.@O@
+OBJS = nsupdate.o
UOBJS =
@@ -61,10 +61,16 @@
MANOBJS = ${MANPAGES} ${HTMLPAGES}
+EXT_CFLAGS = -fPIE
+
@BIND9_MAKE_RULES@
-nsupdate@EXEEXT@: nsupdate.@O@ ${UOBJS} ${DEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ nsupdate.@O@ ${UOBJS} ${LIBS}
+LDFLAGS += -pie -Wl,-z,relro,-z,now,-z,nodlopen,-z,noexecstack
+
+.SUFFIXES: .c .o
+
+nsupdate@EXEEXT@: nsupdate.o ${UOBJS} ${DEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ nsupdate.o ${UOBJS} ${LIBS}
doc man:: ${MANOBJS}
--- bind-9.3.2b1/bin/rndc/Makefile.in.PIE 2004-07-20 03:01:50.000000000 -0400
+++ bind-9.3.2b1/bin/rndc/Makefile.in 2005-10-06 20:05:10.000000000 -0400
@@ -57,28 +57,34 @@
--- bind-9.4.0/bin/rndc/Makefile.in.PIE 2007-01-19 01:55:49.000000000 +0100
+++ bind-9.4.0/bin/rndc/Makefile.in 2007-03-06 12:53:37.000000000 +0100
@@ -59,28 +59,34 @@
MANOBJS = ${MANPAGES} ${HTMLPAGES}
@ -248,8 +56,8 @@
${UOBJS} ${CONFLIBS}
doc man:: ${MANOBJS}
--- bind-9.3.2b1/bin/rndc/unix/Makefile.in.PIE 2004-03-07 23:04:24.000000000 -0500
+++ bind-9.3.2b1/bin/rndc/unix/Makefile.in 2005-10-06 20:04:36.000000000 -0400
--- bind-9.4.0/bin/rndc/unix/Makefile.in.PIE 2004-03-05 05:58:29.000000000 +0100
+++ bind-9.4.0/bin/rndc/unix/Makefile.in 2007-03-06 12:53:37.000000000 +0100
@@ -27,10 +27,16 @@
CDEFINES =
CWARNINGS =
@ -268,8 +76,95 @@
+LDFLAGS += -pie -Wl,-z,relro,-z,now,-z,nodlopen,-z,noexecstack
+
+.SUFFIXES: .c .o
--- bind-9.3.2b1/bin/dig/Makefile.in.PIE 2004-08-18 19:25:57.000000000 -0400
+++ bind-9.3.2b1/bin/dig/Makefile.in 2005-10-06 20:04:36.000000000 -0400
--- bind-9.4.0/bin/check/Makefile.in.PIE 2006-06-09 02:54:08.000000000 +0200
+++ bind-9.4.0/bin/check/Makefile.in 2007-03-06 12:57:46.000000000 +0100
@@ -55,27 +55,33 @@
MANOBJS = ${MANPAGES} ${HTMLPAGES}
+EXT_CFLAGS = -fPIE
+
@BIND9_MAKE_RULES@
-named-checkconf.@O@: named-checkconf.c
- ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
+LDFLAGS += -pie -Wl,-z,relro,-z,now,-z,nodlopen,-z,noexecstack
+
+.SUFFIXES: .c .o
+
+named-checkconf.o: named-checkconf.c
+ ${CC} ${ALL_CFLAGS} \
-DVERSION=\"${VERSION}\" \
-c ${srcdir}/named-checkconf.c
-named-checkzone.@O@: named-checkzone.c
- ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
+named-checkzone.o: named-checkzone.c
+ ${CC} ${ALL_CFLAGS} \
-DVERSION=\"${VERSION}\" \
-c ${srcdir}/named-checkzone.c
-named-checkconf@EXEEXT@: named-checkconf.@O@ check-tool.@O@ ${ISCDEPLIBS} \
+named-checkconf@EXEEXT@: named-checkconf.o check-tool.o ${ISCDEPLIBS} \
${ISCCFGDEPLIBS} ${BIND9DEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
- named-checkconf.@O@ check-tool.@O@ ${BIND9LIBS} ${ISCCFGLIBS} \
+ named-checkconf.o check-tool.o ${BIND9LIBS} ${ISCCFGLIBS} \
${DNSLIBS} ${ISCLIBS} ${LIBS}
-named-checkzone@EXEEXT@: named-checkzone.@O@ check-tool.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
+named-checkzone@EXEEXT@: named-checkzone.o check-tool.o ${ISCDEPLIBS} ${DNSDEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
- named-checkzone.@O@ check-tool.@O@ ${ISCCFGLIBS} ${DNSLIBS} \
+ named-checkzone.o check-tool.o ${ISCCFGLIBS} ${DNSLIBS} \
${ISCLIBS} ${LIBS}
doc man:: ${MANOBJS}
--- bind-9.4.0/bin/dnssec/Makefile.in.PIE 2005-05-02 02:26:11.000000000 +0200
+++ bind-9.4.0/bin/dnssec/Makefile.in 2007-03-06 12:53:37.000000000 +0100
@@ -41,7 +41,7 @@
# Alphabetically
TARGETS = dnssec-keygen@EXEEXT@ dnssec-signzone@EXEEXT@
-OBJS = dnssectool.@O@
+OBJS = dnssectool.o
SRCS = dnssec-keygen.c dnssec-signzone.c dnssectool.c
@@ -51,19 +51,25 @@
MANOBJS = ${MANPAGES} ${HTMLPAGES}
+EXT_CFLAGS = -fPIE
+
@BIND9_MAKE_RULES@
-dnssec-keygen@EXEEXT@: dnssec-keygen.@O@ ${OBJS} ${DEPLIBS}
+LDFLAGS += -pie -Wl,-z,relro,-z,now,-z,nodlopen,-z,noexecstack
+
+.SUFFIXES: .c .o
+
+dnssec-keygen@EXEEXT@: dnssec-keygen.o ${OBJS} ${DEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
- dnssec-keygen.@O@ ${OBJS} ${LIBS}
+ dnssec-keygen.o ${OBJS} ${LIBS}
-dnssec-signzone.@O@: dnssec-signzone.c
- ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} -DVERSION=\"${VERSION}\" \
+dnssec-signzone.o: dnssec-signzone.c
+ ${CC} ${ALL_CFLAGS} -DVERSION=\"${VERSION}\" \
-c ${srcdir}/dnssec-signzone.c
-dnssec-signzone@EXEEXT@: dnssec-signzone.@O@ ${OBJS} ${DEPLIBS}
+dnssec-signzone@EXEEXT@: dnssec-signzone.o ${OBJS} ${DEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
- dnssec-signzone.@O@ ${OBJS} ${LIBS}
+ dnssec-signzone.o ${OBJS} ${LIBS}
doc man:: ${MANOBJS}
--- bind-9.4.0/bin/dig/Makefile.in.PIE 2005-09-09 16:11:04.000000000 +0200
+++ bind-9.4.0/bin/dig/Makefile.in 2007-03-06 12:53:37.000000000 +0100
@@ -51,7 +51,7 @@
TARGETS = dig@EXEEXT@ host@EXEEXT@ nslookup@EXEEXT@
@ -311,3 +206,108 @@
doc man:: ${MANOBJS}
--- bind-9.4.0/bin/named/Makefile.in.PIE 2005-09-05 02:18:10.000000000 +0200
+++ bind-9.4.0/bin/named/Makefile.in 2007-03-06 12:59:02.000000000 +0100
@@ -72,17 +72,17 @@
TARGETS = named@EXEEXT@ lwresd@EXEEXT@
-OBJS = builtin.@O@ client.@O@ config.@O@ control.@O@ \
- controlconf.@O@ interfacemgr.@O@ \
- listenlist.@O@ log.@O@ logconf.@O@ main.@O@ notify.@O@ \
- query.@O@ server.@O@ sortlist.@O@ statschannel.@O@ \
- tkeyconf.@O@ tsigconf.@O@ update.@O@ xfrout.@O@ \
- zoneconf.@O@ \
- lwaddr.@O@ lwresd.@O@ lwdclient.@O@ lwderror.@O@ lwdgabn.@O@ \
- lwdgnba.@O@ lwdgrbn.@O@ lwdnoop.@O@ lwsearch.@O@ \
+OBJS = builtin.o client.o config.o control.o \
+ controlconf.o interfacemgr.o \
+ listenlist.o log.o logconf.o main.o notify.o \
+ query.o server.o sortlist.o statschannel.o \
+ tkeyconf.o tsigconf.o update.o xfrout.o \
+ zoneconf.o \
+ lwaddr.o lwresd.o lwdclient.o lwderror.o lwdgabn.o \
+ lwdgnba.o lwdgrbn.o lwdnoop.o lwsearch.o \
${DLZDRIVER_OBJS} ${DBDRIVER_OBJS}
-UOBJS = unix/os.@O@
+UOBJS = unix/os.o
SRCS = builtin.c client.c config.c control.c \
controlconf.c interfacemgr.c \
@@ -100,16 +100,22 @@
MANOBJS = ${MANPAGES} ${HTMLPAGES}
+EXT_CFLAGS = -fPIE
+
@BIND9_MAKE_RULES@
-main.@O@: main.c
- ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
+LDFLAGS += -pie -Wl,-z,relro,-z,now,-z,nodlopen,-z,noexecstack
+
+.SUFFIXES: .c .o
+
+main.o: main.c
+ ${CC} ${ALL_CFLAGS} \
-DVERSION=\"${VERSION}\" \
-DNS_LOCALSTATEDIR=\"${localstatedir}\" \
-DNS_SYSCONFDIR=\"${sysconfdir}\" -c ${srcdir}/main.c
-config.@O@: config.c
- ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
+config.o: config.c
+ ${CC} ${ALL_CFLAGS} \
-DVERSION=\"${VERSION}\" \
-DNS_LOCALSTATEDIR=\"${localstatedir}\" \
-c ${srcdir}/config.c
--- bind-9.4.0/bin/named/unix/Makefile.in.PIE 2004-03-05 05:58:01.000000000 +0100
+++ bind-9.4.0/bin/named/unix/Makefile.in 2007-03-06 12:53:37.000000000 +0100
@@ -27,10 +27,14 @@
CDEFINES =
CWARNINGS =
-OBJS = os.@O@
+OBJS = os.o
SRCS = os.c
TARGETS = ${OBJS}
+EXT_CFLAGS = -fPIE
+
@BIND9_MAKE_RULES@
+
+.SUFFIXES: .c .o
\ Chybí znak konce řádku na konci souboru
--- bind-9.4.0/bin/nsupdate/Makefile.in.PIE 2004-07-20 09:03:20.000000000 +0200
+++ bind-9.4.0/bin/nsupdate/Makefile.in 2007-03-06 12:53:37.000000000 +0100
@@ -49,7 +49,7 @@
TARGETS = nsupdate@EXEEXT@
-OBJS = nsupdate.@O@
+OBJS = nsupdate.o
UOBJS =
@@ -61,10 +61,16 @@
MANOBJS = ${MANPAGES} ${HTMLPAGES}
+EXT_CFLAGS = -fPIE
+
@BIND9_MAKE_RULES@
-nsupdate@EXEEXT@: nsupdate.@O@ ${UOBJS} ${DEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ nsupdate.@O@ ${UOBJS} ${LIBS}
+LDFLAGS += -pie -Wl,-z,relro,-z,now,-z,nodlopen,-z,noexecstack
+
+.SUFFIXES: .c .o
+
+nsupdate@EXEEXT@: nsupdate.o ${UOBJS} ${DEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ nsupdate.o ${UOBJS} ${LIBS}
doc man:: ${MANOBJS}

View file

@ -1,403 +1,3 @@
--- /dev/null 2005-10-06 11:34:58.093275500 -0400
+++ bind-9.3.2b1/bin/sdb_tools/ldap2zone.c 2005-10-06 18:57:32.000000000 -0400
@@ -0,0 +1,397 @@
+/*
+ * Copyright (C) 2004, 2005 Stig Venaas <venaas@uninett.no>
+ * $Id: ldap2zone.c,v 0.1 2005/04/23 21:30:12 venaas Exp $
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ */
+
+#include <sys/types.h>
+#include <stdio.h>
+
+#include <ldap.h>
+
+struct string {
+ void *data;
+ size_t len;
+};
+
+struct assstack_entry {
+ struct string key;
+ struct string val;
+ struct assstack_entry *next;
+};
+
+struct assstack_entry *assstack_find(struct assstack_entry *stack, struct string *key) {
+ for (; stack; stack = stack->next)
+ if (stack->key.len == key->len && !memcmp(stack->key.data, key->data, key->len))
+ return stack;
+ return NULL;
+}
+
+void assstack_push(struct assstack_entry **stack, struct assstack_entry *item) {
+ item->next = *stack;
+ *stack = item;
+}
+
+void assstack_insertbottom(struct assstack_entry **stack, struct assstack_entry *item) {
+ struct assstack_entry *p;
+
+ item->next = NULL;
+ if (!*stack) {
+ *stack = item;
+ return;
+ }
+ /* find end, should keep track of end somewhere */
+ /* really a queue, not a stack */
+ p = *stack;
+ while (p->next)
+ p = p->next;
+ p->next = item;
+}
+
+void printsoa(struct string *soa) {
+ char *s;
+ int i;
+
+ s = (char *)soa->data;
+ i = 0;
+ while (i < soa->len) {
+ putchar(s[i]);
+ if (s[i++] == ' ')
+ break;
+ }
+ while (i < soa->len) {
+ putchar(s[i]);
+ if (s[i++] == ' ')
+ break;
+ }
+ printf("(\n\t\t\t\t");
+ while (i < soa->len) {
+ putchar(s[i]);
+ if (s[i++] == ' ')
+ break;
+ }
+ printf("; Serialnumber\n\t\t\t\t");
+ while (i < soa->len) {
+ if (s[i] == ' ')
+ break;
+ putchar(s[i++]);
+ }
+ i++;
+ printf("\t; Refresh\n\t\t\t\t");
+ while (i < soa->len) {
+ if (s[i] == ' ')
+ break;
+ putchar(s[i++]);
+ }
+ i++;
+ printf("\t; Retry\n\t\t\t\t");
+ while (i < soa->len) {
+ if (s[i] == ' ')
+ break;
+ putchar(s[i++]);
+ }
+ i++;
+ printf("\t; Expire\n\t\t\t\t");
+ while (i < soa->len) {
+ putchar(s[i++]);
+ }
+ printf(" )\t; Minimum TTL\n");
+}
+
+void printrrs(char *defaultttl, struct assstack_entry *item) {
+ struct assstack_entry *stack;
+ char *s;
+ int first;
+ int i;
+ char *ttl, *type;
+ int top;
+
+ s = (char *)item->key.data;
+
+ if (item->key.len == 1 && *s == '@') {
+ top = 1;
+ printf("@\t");
+ } else {
+ top = 0;
+ for (i = 0; i < item->key.len; i++)
+ putchar(s[i]);
+ if (item->key.len < 8)
+ putchar('\t');
+ putchar('\t');
+ }
+
+ first = 1;
+ for (stack = (struct assstack_entry *) item->val.data; stack; stack = stack->next) {
+ ttl = (char *)stack->key.data;
+ s = strchr(ttl, ' ');
+ *s++ = '\0';
+ type = s;
+
+ if (first)
+ first = 0;
+ else
+ printf("\t\t");
+
+ if (strcmp(defaultttl, ttl))
+ printf("%s", ttl);
+ putchar('\t');
+
+ if (top) {
+ top = 0;
+ printf("IN\t%s\t", type);
+ /* Should always be SOA here */
+ if (!strcmp(type, "SOA")) {
+ printsoa(&stack->val);
+ continue;
+ }
+ } else
+ printf("%s\t", type);
+
+ s = (char *)stack->val.data;
+ for (i = 0; i < stack->val.len; i++)
+ putchar(s[i]);
+ putchar('\n');
+ }
+}
+
+void print_zone(char *defaultttl, struct assstack_entry *stack) {
+ printf("$TTL %s\n", defaultttl);
+ for (; stack; stack = stack->next)
+ printrrs(defaultttl, stack);
+};
+
+void usage(char *name) {
+ fprintf(stderr, "Usage:%s zone-name LDAP-URL default-ttl [serial]\n", name);
+ exit(1);
+};
+
+void err(char *name, char *msg) {
+ fprintf(stderr, "%s: %s\n", name, msg);
+ exit(1);
+};
+
+int putrr(struct assstack_entry **stack, struct berval *name, char *type, char *ttl, struct berval *val) {
+ struct string key;
+ struct assstack_entry *rr, *rrdata;
+
+ /* Do nothing if name or value have 0 length */
+ if (!name->bv_len || !val->bv_len)
+ return 0;
+
+ /* see if already have an entry for this name */
+ key.len = name->bv_len;
+ key.data = name->bv_val;
+
+ rr = assstack_find(*stack, &key);
+ if (!rr) {
+ /* Not found, create and push new entry */
+ rr = (struct assstack_entry *) malloc(sizeof(struct assstack_entry));
+ if (!rr)
+ return -1;
+ rr->key.len = name->bv_len;
+ rr->key.data = (void *) malloc(rr->key.len);
+ if (!rr->key.data) {
+ free(rr);
+ return -1;
+ }
+ memcpy(rr->key.data, name->bv_val, name->bv_len);
+ rr->val.len = sizeof(void *);
+ rr->val.data = NULL;
+ if (name->bv_len == 1 && *(char *)name->bv_val == '@')
+ assstack_push(stack, rr);
+ else
+ assstack_insertbottom(stack, rr);
+ }
+
+ rrdata = (struct assstack_entry *) malloc(sizeof(struct assstack_entry));
+ if (!rrdata) {
+ free(rr->key.data);
+ free(rr);
+ return -1;
+ }
+ rrdata->key.len = strlen(type) + strlen(ttl) + 1;
+ rrdata->key.data = (void *) malloc(rrdata->key.len);
+ if (!rrdata->key.data) {
+ free(rrdata);
+ free(rr->key.data);
+ free(rr);
+ return -1;
+ }
+ sprintf((char *)rrdata->key.data, "%s %s", ttl, type);
+
+ rrdata->val.len = val->bv_len;
+ rrdata->val.data = (void *) malloc(val->bv_len);
+ if (!rrdata->val.data) {
+ free(rrdata->key.data);
+ free(rrdata);
+ free(rr->key.data);
+ free(rr);
+ return -1;
+ }
+ memcpy(rrdata->val.data, val->bv_val, val->bv_len);
+
+ if (!strcmp(type, "SOA"))
+ assstack_push((struct assstack_entry **) &(rr->val.data), rrdata);
+ else
+ assstack_insertbottom((struct assstack_entry **) &(rr->val.data), rrdata);
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ char *s, *hostporturl, *base = NULL;
+ char *ttl, *defaultttl;
+ LDAP *ld;
+ char *fltr = NULL;
+ LDAPMessage *res, *e;
+ char *a, **ttlvals, **soavals, *serial;
+ struct berval **vals, **names;
+ char type[64];
+ BerElement *ptr;
+ int i, j, rc, msgid;
+ struct assstack_entry *zone = NULL;
+
+ if (argc < 4 || argc > 5)
+ usage(argv[0]);
+
+ hostporturl = argv[2];
+
+ if (hostporturl != strstr( hostporturl, "ldap"))
+ err(argv[0], "Not an LDAP URL");
+
+ s = strchr(hostporturl, ':');
+
+ if (!s || strlen(s) < 3 || s[1] != '/' || s[2] != '/')
+ err(argv[0], "Not an LDAP URL");
+
+ s = strchr(s+3, '/');
+ if (s) {
+ *s++ = '\0';
+ base = s;
+ s = strchr(base, '?');
+ if (s)
+ err(argv[0], "LDAP URL can only contain host, port and base");
+ }
+
+ defaultttl = argv[3];
+
+ rc = ldap_initialize(&ld, hostporturl);
+ if (rc != LDAP_SUCCESS)
+ err(argv[0], "ldap_initialize() failed");
+
+ if (argc == 5) {
+ /* serial number specified, check if different from one in SOA */
+ fltr = (char *)malloc(strlen(argv[1]) + strlen("(&(relativeDomainName=@)(zoneName=))") + 1);
+ sprintf(fltr, "(&(relativeDomainName=@)(zoneName=%s))", argv[1]);
+ msgid = ldap_search(ld, base, LDAP_SCOPE_SUBTREE, fltr, NULL, 0);
+ if (msgid == -1)
+ err(argv[0], "ldap_search() failed");
+
+ while ((rc = ldap_result(ld, msgid, 0, NULL, &res)) != LDAP_RES_SEARCH_RESULT ) {
+ /* not supporting continuation references at present */
+ if (rc != LDAP_RES_SEARCH_ENTRY)
+ err(argv[0], "ldap_result() returned cont.ref? Exiting");
+
+ /* only one entry per result message */
+ e = ldap_first_entry(ld, res);
+ if (e == NULL) {
+ ldap_msgfree(res);
+ err(argv[0], "ldap_first_entry() failed");
+ }
+
+ soavals = ldap_get_values(ld, e, "SOARecord");
+ if (soavals)
+ break;
+ }
+
+ ldap_msgfree(res);
+ if (!soavals) {
+ err(argv[0], "No SOA Record found");
+ }
+
+ /* We have a SOA, compare serial numbers */
+ /* Only checkinf first value, should be only one */
+ s = strchr(soavals[0], ' ');
+ s++;
+ s = strchr(s, ' ');
+ s++;
+ serial = s;
+ s = strchr(s, ' ');
+ *s = '\0';
+ if (!strcmp(serial, argv[4])) {
+ ldap_value_free(soavals);
+ err(argv[0], "serial numbers match");
+ }
+ ldap_value_free(soavals);
+ }
+
+ if (!fltr)
+ fltr = (char *)malloc(strlen(argv[1]) + strlen("(zoneName=)") + 1);
+ if (!fltr)
+ err(argv[0], "Malloc failed");
+ sprintf(fltr, "(zoneName=%s)", argv[1]);
+
+ msgid = ldap_search(ld, base, LDAP_SCOPE_SUBTREE, fltr, NULL, 0);
+ if (msgid == -1)
+ err(argv[0], "ldap_search() failed");
+
+ while ((rc = ldap_result(ld, msgid, 0, NULL, &res)) != LDAP_RES_SEARCH_RESULT ) {
+ /* not supporting continuation references at present */
+ if (rc != LDAP_RES_SEARCH_ENTRY)
+ err(argv[0], "ldap_result() returned cont.ref? Exiting");
+
+ /* only one entry per result message */
+ e = ldap_first_entry(ld, res);
+ if (e == NULL) {
+ ldap_msgfree(res);
+ err(argv[0], "ldap_first_entry() failed");
+ }
+
+ names = ldap_get_values_len(ld, e, "relativeDomainName");
+ if (!names)
+ continue;
+
+ ttlvals = ldap_get_values(ld, e, "dNSTTL");
+ ttl = ttlvals ? ttlvals[0] : defaultttl;
+
+ for (a = ldap_first_attribute(ld, e, &ptr); a != NULL; a = ldap_next_attribute(ld, e, ptr)) {
+ char *s;
+
+ for (s = a; *s; s++)
+ *s = toupper(*s);
+ s = strstr(a, "RECORD");
+ if ((s == NULL) || (s == a) || (s - a >= (signed int)sizeof(type))) {
+ ldap_memfree(a);
+ continue;
+ }
+
+ strncpy(type, a, s - a);
+ type[s - a] = '\0';
+ vals = ldap_get_values_len(ld, e, a);
+ if (vals) {
+ for (i = 0; vals[i]; i++)
+ for (j = 0; names[j]; j++)
+ if (putrr(&zone, names[j], type, ttl, vals[i]))
+ err(argv[0], "malloc failed");
+ ldap_value_free_len(vals);
+ }
+ ldap_memfree(a);
+ }
+
+ if (ptr)
+ ber_free(ptr, 0);
+ if (ttlvals)
+ ldap_value_free(ttlvals);
+ ldap_value_free_len(names);
+ /* free this result */
+ ldap_msgfree(res);
+ }
+
+ /* free final result */
+ ldap_msgfree(res);
+
+ print_zone(defaultttl, zone);
+ return 0;
+}
--- bind-9.3.2b1/bin/sdb_tools/Makefile.in.fix_sdb_ldap 2005-02-17 01:43:28.000000000 -0500
+++ bind-9.3.2b1/bin/sdb_tools/Makefile.in 2005-10-06 18:57:32.000000000 -0400
@@ -30,11 +30,11 @@

View file

@ -0,0 +1,58 @@
--- bind-9.4.0/bin/rndc/rndc-confgen.8.key 2007-01-30 01:23:44.000000000 +0100
+++ bind-9.4.0/bin/rndc/rndc-confgen.8 2007-03-06 12:42:15.000000000 +0100
@@ -125,7 +125,7 @@
\-k \fIkeyname\fR
.RS 4
Specifies the key name of the rndc authentication key. This must be a valid domain name. The default is
-\fBrndc\-key\fR.
+\fBrndckey\fR.
.RE
.PP
\-p \fIport\fR
--- bind-9.4.0/bin/rndc/rndc-confgen.c.key 2005-04-29 02:15:40.000000000 +0200
+++ bind-9.4.0/bin/rndc/rndc-confgen.c 2007-03-06 12:41:33.000000000 +0100
@@ -57,7 +57,7 @@
#include "util.h"
#define DEFAULT_KEYLENGTH 128 /*% Bits. */
-#define DEFAULT_KEYNAME "rndc-key"
+#define DEFAULT_KEYNAME "rndckey"
#define DEFAULT_SERVER "127.0.0.1"
#define DEFAULT_PORT 953
--- bind-9.4.0/bin/rndc/rndc.conf.key 2004-06-18 06:39:39.000000000 +0200
+++ bind-9.4.0/bin/rndc/rndc.conf 2007-03-06 12:44:06.000000000 +0100
@@ -23,11 +23,11 @@
options {
default-server localhost;
- default-key "key";
+ default-key "rndckey";
};
server localhost {
- key "key";
+ key "rndckey";
};
key "cc64b3d1db63fc88d7cb5d2f9f57d258" {
@@ -41,7 +41,4 @@
addresses { 10.53.0.1; };
};
-key "key" {
- algorithm hmac-md5;
- secret "c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K";
-};
+include "/etc/rndc.key";
--- bind-9.4.0/bin/rndc/rndc-confgen.docbook.key 2007-01-30 00:57:20.000000000 +0100
+++ bind-9.4.0/bin/rndc/rndc-confgen.docbook 2007-03-06 12:44:45.000000000 +0100
@@ -163,7 +163,7 @@
<para>
Specifies the key name of the rndc authentication key.
This must be a valid domain name.
- The default is <constant>rndc-key</constant>.
+ The default is <constant>rndckey</constant>.
</para>
</listitem>
</varlistentry>

View file

@ -0,0 +1,13 @@
--- bind-9.4.0/bin/dnssec/dnssec-signzone.c.directory 2007-04-11 15:42:56.000000000 +0200
+++ bind-9.4.0/bin/dnssec/dnssec-signzone.c 2007-04-11 15:43:23.000000000 +0200
@@ -1470,8 +1470,8 @@
fatal("failed to find the zone's origin: %s",
isc_result_totext(result));
- result = dns_dnssec_findzonekeys(db, currentversion, node, gorigin,
- mctx, 20, keys, &nkeys);
+ result = dns_dnssec_findzonekeys2(db, currentversion, node, gorigin,
+ directory, mctx, 20, keys, &nkeys);
if (result == ISC_R_NOTFOUND)
result = ISC_R_SUCCESS;
if (result != ISC_R_SUCCESS)

View file

@ -0,0 +1,102 @@
diff -up bind-9.5.0b2/bin/named-sdb/main.c.sdb-sqlite-bld bind-9.5.0b2/bin/named-sdb/main.c
--- bind-9.5.0b2/bin/named-sdb/main.c.sdb-sqlite-bld 2008-02-14 15:06:44.000000000 +0100
+++ bind-9.5.0b2/bin/named-sdb/main.c 2008-02-14 15:06:44.000000000 +0100
@@ -74,6 +74,7 @@
/* #include "xxdb.h" */
#include "ldapdb.h"
#include "pgsqldb.h"
+#include "sqlitedb.h"
#include "dirdb.h"
/*
@@ -646,6 +647,7 @@ setup(void) {
ldapdb_clear();
pgsqldb_clear();
+ sqlitedb_clear();
dirdb_clear();
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
@@ -743,6 +745,23 @@ setup(void) {
ISC_LOG_NOTICE, "SDB postgreSQL DB zone database module loaded."
);
+ result = sqlitedb_init();
+ if (result != ISC_R_SUCCESS)
+ {
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_ERROR,
+ "SDB sqlite3 module initialisation failed: %s.",
+ isc_result_totext(result)
+ );
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_ERROR,
+ "SDB sqlite3 zone database will be unavailable."
+ );
+ }else
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_NOTICE, "SDB sqlite3 DB zone database module loaded."
+ );
+
result = dirdb_init();
if (result != ISC_R_SUCCESS)
{
@@ -787,6 +806,7 @@ cleanup(void) {
ldapdb_clear();
pgsqldb_clear();
+ sqlitedb_clear();
dirdb_clear();
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
diff -up bind-9.5.0b2/bin/named-sdb/Makefile.in.sdb-sqlite-bld bind-9.5.0b2/bin/named-sdb/Makefile.in
--- bind-9.5.0b2/bin/named-sdb/Makefile.in.sdb-sqlite-bld 2008-02-14 15:06:44.000000000 +0100
+++ bind-9.5.0b2/bin/named-sdb/Makefile.in 2008-02-14 15:10:56.000000000 +0100
@@ -26,10 +26,10 @@ top_srcdir = @top_srcdir@
#
# Add database drivers here.
#
-DBDRIVER_OBJS = ldapdb.o pgsqldb.o dirdb.o
-DBDRIVER_SRCS = ldapdb.c pgsqldb.c dirdb.c
+DBDRIVER_OBJS = ldapdb.o pgsqldb.o dirdb.o sqlitedb.o
+DBDRIVER_SRCS = ldapdb.c pgsqldb.c dirdb.c sqlitedb.c
DBDRIVER_INCLUDES =
-DBDRIVER_LIBS = -lldap -llber -lpq
+DBDRIVER_LIBS = -lldap -llber -lpq -lsqlite3
DLZ_DRIVER_DIR = ${top_srcdir}/contrib/dlz/drivers
diff -up bind-9.5.0b2/bin/sdb_tools/Makefile.in.sdb-sqlite-bld bind-9.5.0b2/bin/sdb_tools/Makefile.in
--- bind-9.5.0b2/bin/sdb_tools/Makefile.in.sdb-sqlite-bld 2008-02-14 15:06:44.000000000 +0100
+++ bind-9.5.0b2/bin/sdb_tools/Makefile.in 2008-02-14 15:06:44.000000000 +0100
@@ -30,11 +30,11 @@ DEPLIBS = ${LWRESDEPLIBS} ${DNSDEPLIBS}
LIBS = ${LWRESLIBS} ${DNSLIBS} ${BIND9LIBS} \
${ISCCFGLIBS} ${ISCCCLIBS} ${ISCLIBS} ${DBDRIVER_LIBS} @LIBS@
-TARGETS = zone2ldap@EXEEXT@ ldap2zone@EXEEXT@ zonetodb@EXEEXT@
+TARGETS = zone2ldap@EXEEXT@ ldap2zone@EXEEXT@ zonetodb@EXEEXT@ zone2sqlite@EXEEXT@
-OBJS = zone2ldap.o ldap2zone.o zonetodb.o
+OBJS = zone2ldap.o ldap2zone.o zonetodb.o zone2sqlite
-SRCS = zone2ldap.c ldap2zone.c zonetodb.c
+SRCS = zone2ldap.c ldap2zone.c zonetodb.c zone2sqlite.c
MANPAGES = zone2ldap.1
@@ -54,6 +54,9 @@ zone2ldap: zone2ldap.o ${DEPLIBS}
zonetodb: zonetodb.o ${DEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ zonetodb.o -lpq ${LIBS}
+zone2sqlite: zone2sqlite.o ${DEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ zone2sqlite.o -lsqlite3 -lssl ${LIBS}
+
ldap2zone: ldap2zone.o ${DEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ ldap2zone.o -lldap -llber ${LIBS}
@@ -68,4 +71,5 @@ install:: ${TARGETS} installdirs
${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} zone2ldap ${DESTDIR}${sbindir}
${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} ldap2zone ${DESTDIR}${sbindir}
${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} zonetodb ${DESTDIR}${sbindir}
+ ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} zone2sqlite ${DESTDIR}${sbindir}
${INSTALL_DATA} ${srcdir}/zone2ldap.1 ${DESTDIR}${mandir}/man1/zone2ldap.1

23
bind-9.4.1-ldap-api.patch Normal file
View file

@ -0,0 +1,23 @@
--- bind-9.3.4/bin/named-sdb/Makefile.in.ldap-api 2007-05-18 16:21:21.000000000 +0200
+++ bind-9.3.4/bin/named-sdb/Makefile.in 2007-05-18 16:22:16.000000000 +0200
@@ -96,7 +96,7 @@ HTMLPAGES = named.html lwresd.html named
MANOBJS = ${MANPAGES} ${HTMLPAGES}
-EXT_CFLAGS = -fPIE
+EXT_CFLAGS = -fPIE -DLDAP_DEPRECATED
@BIND9_MAKE_RULES@
diff -up bind-9.5.0a5/bin/sdb_tools/Makefile.in.new-api bind-9.5.0a5/bin/sdb_tools/Makefile.in
--- bind-9.5.0a5/bin/sdb_tools/Makefile.in.new-api 2007-07-18 11:07:07.000000000 +0200
+++ bind-9.5.0a5/bin/sdb_tools/Makefile.in 2007-07-18 11:07:18.000000000 +0200
@@ -38,7 +38,7 @@ SRCS = zone2ldap.c ldap2zone.c
MANPAGES = zone2ldap.1
-EXT_CFLAGS = -fPIE
+EXT_CFLAGS = -fPIE -DLDAP_DEPRECATED
@BIND9_MAKE_RULES@

63
bind-9.5-dbus-leak.patch Normal file
View file

@ -0,0 +1,63 @@
Written-by: Adam Tkac <atkac@redhat.com>
diff -up bind-9.5.0a6/contrib/dbus/dbus_mgr.c.leak bind-9.5.0a6/contrib/dbus/dbus_mgr.c
--- bind-9.5.0a6/contrib/dbus/dbus_mgr.c.leak 2007-05-10 07:47:02.000000000 +0200
+++ bind-9.5.0a6/contrib/dbus/dbus_mgr.c 2007-10-18 13:32:19.000000000 +0200
@@ -167,6 +167,9 @@ dbus_mgr_init_dbus(ns_dbus_mgr_t *);
static isc_result_t
dbus_mgr_record_initial_fwdtable(ns_dbus_mgr_t *);
+static
+dns_fwdtable_t *dbus_mgr_get_fwdtable(void);
+
static void
dbus_mgr_free_initial_fwdtable(ns_dbus_mgr_t *);
@@ -272,6 +275,8 @@ dbus_mgr_create
return ISC_R_SUCCESS;
cleanup_mgr:
+ if ( dbus_mgr_get_fwdtable() != NULL)
+ dbus_mgr_free_initial_fwdtable (mgr);
if( mgr->task != 0L )
isc_task_detach(&(mgr->task));
isc_mem_put(mctx, mgr, sizeof(*mgr));
@@ -623,7 +628,7 @@ static void dbus_mgr_record_initial_forw
dns_name_init(&(ifwdr->dn), NULL);
if( dns_name_dupwithoffsets(name, mgr->mctx, &(ifwdr->dn)) != ISC_R_SUCCESS )
- return;
+ goto namedup_err;
ISC_LIST_INIT(ifwdr->sa);
@@ -634,14 +639,27 @@ static void dbus_mgr_record_initial_forw
{
nsa = isc_mem_get(mgr->mctx, sizeof(isc_sockaddr_t));
if( nsa == 0L )
- return;
+ goto nsa_err;
*nsa = *sa;
ISC_LINK_INIT(nsa, link);
ISC_LIST_APPEND(ifwdr->sa, nsa, link);
}
ISC_LINK_INIT(ifwdr, link);
tsearch( ifwdr, &(mgr->ifwdt), dbus_mgr_ifwdr_comparator);
-}
+
+ return;
+
+nsa_err:
+ while ( (sa = ISC_LIST_HEAD (ifwdr->sa)) != NULL) {
+ ISC_LIST_UNLINK (ifwdr->sa, sa, link);
+ isc_mem_put (mgr->mctx, sa, sizeof (*sa));
+ }
+
+namedup_err:
+ isc_mem_put (mgr->mctx, ifwdr, sizeof (*ifwdr));
+
+ return;
+}
static isc_result_t
dbus_mgr_record_initial_fwdtable( ns_dbus_mgr_t *mgr )

View file

@ -0,0 +1,29 @@
Written-by: Peter Jones <pjones@redhat.com>
Reviewed-by: Adam Tkac <atkac@redhat.com>
--- bind-9.5.0a6/contrib/dbus/dbus_service.c.va_end 2007-10-17 14:55:10.000000000 -0400
+++ bind-9.5.0a6/contrib/dbus/dbus_service.c 2007-10-17 14:56:20.000000000 -0400
@@ -200,6 +200,7 @@ dbus_svc_add_filter
}
}
}
+ va_end(va);
return( 1 );
}
@@ -424,6 +425,7 @@ dbus_svc_message_append_args(DBusConnect
if( !dbus_message_append_args_valist( msg, firstType, va ) )
{
if( cs->eh != 0L ) (*(cs->eh))("dbus_svc_send: dbus_message_append_args failed");
+ va_end(va);
return 0;
}
va_end(va);
@@ -488,6 +490,7 @@ dbus_svc_call
va_end(va);
return(0L);
}
+ va_end(va);
return reply;
}

View file

@ -0,0 +1,13 @@
--- bind-9.4.0/bin/named/Makefile.in.dbus_archdep_libdir 2007-03-06 14:18:14.000000000 +0100
+++ bind-9.4.0/bin/named/Makefile.in 2007-03-06 14:20:39.000000000 +0100
@@ -43,8 +43,9 @@
${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} ${ISC_INCLUDES} \
${DLZDRIVER_INCLUDES} ${DBDRIVER_INCLUDES}
+DBUS_ARCHDEP_LIBDIR ?= lib
DBUS_INCLUDES = \
- -I/usr/lib/dbus-1.0/include -I/usr/include/dbus-1.0
+ -I/usr/${DBUS_ARCHDEP_LIBDIR}/dbus-1.0/include -I/usr/include/dbus-1.0
CDEFINES = @USE_DLZ@

84
bind-9.5-dlz-64bit.patch Normal file
View file

@ -0,0 +1,84 @@
diff -up bind-9.5.0a5/contrib/dlz/config.dlz.in.64bit bind-9.5.0a5/contrib/dlz/config.dlz.in
--- bind-9.5.0a5/contrib/dlz/config.dlz.in.64bit 2006-06-07 04:21:50.000000000 +0200
+++ bind-9.5.0a5/contrib/dlz/config.dlz.in 2007-07-23 11:18:54.000000000 +0200
@@ -17,6 +17,13 @@
#
dlzdir='${DLZ_DRIVER_DIR}'
+AC_MSG_CHECKING([for target libdir])
+AC_RUN_IFELSE([int main(void) {exit((sizeof(void *) == 8) ? 0 : 1);}],
+ [target_lib=lib64],
+ [target_lib=lib],
+)
+AC_MSG_RESULT(["$target_lib"])
+
#
# Private autoconf macro to simplify configuring drivers:
#
@@ -83,7 +90,7 @@ then
if test -f $d/include/libpq-fe.h
then
use_dlz_postgres=$d/include
- use_dlz_postgres_lib=$d/lib
+ use_dlz_postgres_lib=$d/${target_lib}
break
fi
done
@@ -151,10 +158,10 @@ case "$use_dlz_mysql" in
*)
DLZ_ADD_DRIVER(MYSQL, dlz_mysql_driver,
[-I$use_dlz_mysql/include/mysql],
- [-L$use_dlz_mysql/lib/mysql -lmysqlclient -lz -lcrypt -lm])
+ [-L$use_dlz_mysql/${target_lib}/mysql -lmysqlclient -lz -lcrypt -lm])
AC_MSG_RESULT(
-[using mysql from $use_dlz_mysql/lib/mysql and $use_dlz_mysql/include/mysql])
+[using mysql from $use_dlz_mysql/${target_lib}/mysql and $use_dlz_mysql/include/mysql])
;;
esac
@@ -232,11 +239,11 @@ case "$use_dlz_bdb" in
bdb_libnames="db42 db-4.2 db41 db-4.1 db"
for d in $bdb_libnames
do
- if test -f "$dd/lib/lib${d}.so"
+ if test -f "$dd/${target_lib}/lib${d}.so"
then
if test "$dd" != "/usr"
then
- dlz_bdb_libs="-L${dd}/lib "
+ dlz_bdb_libs="-L${dd}/${target_lib} "
else
dlz_bdb_libs=""
fi
@@ -341,10 +348,10 @@ case "$use_dlz_ldap" in
*)
DLZ_ADD_DRIVER(LDAP, dlz_ldap_driver,
[-I$use_dlz_ldap/include],
- [-L$use_dlz_ldap/lib -lldap -llber])
+ [-L$use_dlz_ldap/${target_lib} -lldap -llber])
AC_MSG_RESULT(
-[using LDAP from $use_dlz_ldap/lib and $use_dlz_ldap/include])
+[using LDAP from $use_dlz_ldap/${target_lib} and $use_dlz_ldap/include])
;;
esac
@@ -365,7 +372,7 @@ then
odbcdirs="/usr /usr/local /usr/pkg"
for d in $odbcdirs
do
- if test -f $d/include/sql.h -a -f $d/lib/libodbc.a
+ if test -f $d/include/sql.h -a -f $d/${target_lib}/libodbc.a
then
use_dlz_odbc=$d
break
@@ -385,7 +392,7 @@ case "$use_dlz_odbc" in
*)
DLZ_ADD_DRIVER(ODBC, dlz_odbc_driver,
[-I$use_dlz_odbc/include],
- [-L$use_dlz_odbc/lib -lodbc])
+ [-L$use_dlz_odbc/${target_lib} -lodbc])
AC_MSG_RESULT([using ODBC from $use_dlz_odbc])
;;

101
bind-9.5-edns.patch Normal file
View file

@ -0,0 +1,101 @@
diff -up bind-9.5.0b2/lib/dns/view.c.edns bind-9.5.0b2/lib/dns/view.c
--- bind-9.5.0b2/lib/dns/view.c.edns 2007-06-19 01:47:42.000000000 +0200
+++ bind-9.5.0b2/lib/dns/view.c 2008-02-12 13:35:36.000000000 +0100
@@ -179,6 +179,7 @@ dns_view_create(isc_mem_t *mctx, dns_rda
view->flush = ISC_FALSE;
view->dlv = NULL;
view->maxudp = 0;
+ view->edns = ISC_TRUE;
dns_fixedname_init(&view->dlv_fixed);
result = dns_order_create(view->mctx, &view->order);
diff -up bind-9.5.0b2/lib/dns/resolver.c.edns bind-9.5.0b2/lib/dns/resolver.c
--- bind-9.5.0b2/lib/dns/resolver.c.edns 2008-01-18 00:46:37.000000000 +0100
+++ bind-9.5.0b2/lib/dns/resolver.c 2008-02-12 13:50:04.000000000 +0100
@@ -1514,10 +1514,12 @@ resquery_send(resquery_t *query) {
* The ADB does not know about servers with "edns no". Check this,
* and then inform the ADB for future use.
*/
- if ((query->addrinfo->flags & DNS_FETCHOPT_NOEDNS0) == 0 &&
- peer != NULL &&
- dns_peer_getsupportedns(peer, &useedns) == ISC_R_SUCCESS &&
- !useedns)
+ if (((query->addrinfo->flags & DNS_FETCHOPT_NOEDNS0) == 0 ||
+ (query->options & DNS_FETCHOPT_NOEDNS0) == 0) &&
+ (!(res->view->edns) ||
+ (peer != NULL &&
+ dns_peer_getsupportedns(peer, &useedns) == ISC_R_SUCCESS &&
+ !useedns)))
{
query->options |= DNS_FETCHOPT_NOEDNS0;
dns_adb_changeflags(fctx->adb,
diff -up bind-9.5.0b2/lib/dns/include/dns/view.h.edns bind-9.5.0b2/lib/dns/include/dns/view.h
--- bind-9.5.0b2/lib/dns/include/dns/view.h.edns 2007-06-19 01:47:42.000000000 +0200
+++ bind-9.5.0b2/lib/dns/include/dns/view.h 2008-02-12 13:35:36.000000000 +0100
@@ -137,6 +137,7 @@ struct dns_view {
dns_name_t * dlv;
dns_fixedname_t dlv_fixed;
isc_uint16_t maxudp;
+ isc_boolean_t edns;
/*
* Configurable data for server use only,
diff -up bind-9.5.0b2/lib/isccfg/namedconf.c.edns bind-9.5.0b2/lib/isccfg/namedconf.c
--- bind-9.5.0b2/lib/isccfg/namedconf.c.edns 2008-01-22 01:31:00.000000000 +0100
+++ bind-9.5.0b2/lib/isccfg/namedconf.c 2008-02-12 13:35:36.000000000 +0100
@@ -618,6 +618,7 @@ options_clauses[] = {
{ "deallocate-on-exit", &cfg_type_boolean, CFG_CLAUSEFLAG_OBSOLETE },
{ "directory", &cfg_type_qstring, CFG_CLAUSEFLAG_CALLBACK },
{ "dump-file", &cfg_type_qstring, 0 },
+ { "edns", &cfg_type_boolean, 0 },
{ "fake-iquery", &cfg_type_boolean, CFG_CLAUSEFLAG_OBSOLETE },
{ "files", &cfg_type_size, 0 },
{ "has-old-clients", &cfg_type_boolean, CFG_CLAUSEFLAG_OBSOLETE },
diff -up bind-9.5.0b2/doc/misc/options.edns bind-9.5.0b2/doc/misc/options
--- bind-9.5.0b2/doc/misc/options.edns 2008-01-22 02:45:23.000000000 +0100
+++ bind-9.5.0b2/doc/misc/options 2008-02-12 13:35:36.000000000 +0100
@@ -97,6 +97,7 @@ options {
<integer>] | <ipv4_address> [port <integer>] | <ipv6_address>
[port <integer>] ); ... };
dump-file <quoted_string>;
+ edns <boolean>;
edns-udp-size <integer>;
empty-contact <string>;
empty-server <string>;
diff -up bind-9.5.0b2/bin/named/config.c.edns bind-9.5.0b2/bin/named/config.c
--- bind-9.5.0b2/bin/named/config.c.edns 2008-01-23 00:27:35.000000000 +0100
+++ bind-9.5.0b2/bin/named/config.c 2008-02-12 13:35:36.000000000 +0100
@@ -137,6 +137,7 @@ options {\n\
acache-enable no;\n\
acache-cleaning-interval 60;\n\
max-acache-size 16M;\n\
+ edns yes;\n\
dnssec-enable yes;\n\
dnssec-validation no; /* Make yes for 9.5. */ \n\
dnssec-accept-expired no;\n\
diff -up bind-9.5.0b2/bin/named/server.c.edns bind-9.5.0b2/bin/named/server.c
--- bind-9.5.0b2/bin/named/server.c.edns 2008-01-24 03:29:56.000000000 +0100
+++ bind-9.5.0b2/bin/named/server.c 2008-02-12 13:52:25.000000000 +0100
@@ -1667,6 +1667,11 @@ configure_view(dns_view_t *view, const c
max_clients_per_query);
obj = NULL;
+ result = ns_config_get(maps, "edns", &obj);
+ INSIST(result == ISC_R_SUCCESS);
+ view->edns = cfg_obj_asboolean(obj);
+
+ obj = NULL;
result = ns_config_get(maps, "dnssec-enable", &obj);
INSIST(result == ISC_R_SUCCESS);
view->enablednssec = cfg_obj_asboolean(obj);
diff -up bind-9.5.0b2/bin/named/named.conf.5.edns bind-9.5.0b2/bin/named/named.conf.5
--- bind-9.5.0b2/bin/named/named.conf.5.edns 2007-10-22 00:15:32.000000000 +0200
+++ bind-9.5.0b2/bin/named/named.conf.5 2008-02-12 13:35:36.000000000 +0100
@@ -160,6 +160,7 @@ options {
datasize \fIsize\fR;
directory \fIquoted_string\fR;
dump\-file \fIquoted_string\fR;
+ edns \fIboolean\fR;
files \fIsize\fR;
heartbeat\-interval \fIinteger\fR;
host\-statistics \fIboolean\fR; // not implemented

267
bind-9.5-libidn.patch Normal file
View file

@ -0,0 +1,267 @@
diff -up bind-9.5.0a6/bin/dig/Makefile.in.libidn bind-9.5.0a6/bin/dig/Makefile.in
--- bind-9.5.0a6/bin/dig/Makefile.in.libidn 2007-07-29 13:17:00.000000000 +0200
+++ bind-9.5.0a6/bin/dig/Makefile.in 2007-07-29 13:17:01.000000000 +0200
@@ -45,7 +45,7 @@ DEPLIBS = ${DNSDEPLIBS} ${BIND9DEPLIBS}
${LWRESDEPLIBS}
LIBS = ${LWRESLIBS} ${DNSLIBS} ${BIND9LIBS} ${ISCLIBS} \
- ${ISCCFGLIBS} @IDNLIBS@ @LIBS@
+ ${ISCCFGLIBS} @IDNLIBS@ @LIBS@ -lidn
SUBDIRS =
@@ -63,7 +63,7 @@ HTMLPAGES = dig.html host.html nslookup.
MANOBJS = ${MANPAGES} ${HTMLPAGES}
-EXT_CFLAGS = -fPIE
+EXT_CFLAGS = -fPIE -DWITH_LIBIDN
@BIND9_MAKE_RULES@
diff -up bind-9.5.0a6/bin/dig/dighost.c.libidn bind-9.5.0a6/bin/dig/dighost.c
--- bind-9.5.0a6/bin/dig/dighost.c.libidn 2007-06-19 01:47:17.000000000 +0200
+++ bind-9.5.0a6/bin/dig/dighost.c 2007-07-30 14:58:19.000000000 +0200
@@ -44,6 +44,11 @@
#include <idn/api.h>
#endif
+#ifdef WITH_LIBIDN
+#include <stringprep.h>
+#include <idna.h>
+#endif
+
#include <dns/byaddr.h>
#ifdef DIG_SIGCHASE
#include <dns/dnssec.h>
@@ -147,6 +152,14 @@ static void idn_check_result(idn_result
int idnoptions = 0;
#endif
+#ifdef WITH_LIBIDN
+static isc_result_t libidn_locale_to_utf8 (const char* from, char **to);
+static isc_result_t libidn_utf8_to_ascii (const char* from, char *to);
+static isc_result_t output_filter (isc_buffer_t *buffer,
+ unsigned int used_org,
+ isc_boolean_t absolute);
+#endif
+
/*%
* Exit Codes:
*
@@ -1002,6 +1015,9 @@ void
setup_system(void) {
dig_searchlist_t *domain = NULL;
lwres_result_t lwresult;
+#ifdef WITH_LIBIDN
+ isc_result_t result;
+#endif
debug("setup_system()");
@@ -1050,8 +1066,15 @@ setup_system(void) {
#ifdef WITH_IDN
initialize_idn();
+
+#endif
+#ifdef WITH_LIBIDN
+ result = dns_name_settotextfilter(output_filter);
+ check_result(result, "dns_name_settotextfilter");
+#ifdef HAVE_SETLOCALE
+ setlocale (LC_ALL, "");
+#endif
#endif
-
if (keyfile[0] != 0)
setup_file_key();
else if (keysecret[0] != 0)
@@ -1740,12 +1763,18 @@ setup_lookup(dig_lookup_t *lookup) {
idn_result_t mr;
char utf8_textname[MXNAME], utf8_origin[MXNAME], idn_textname[MXNAME];
#endif
+#ifdef WITH_LIBIDN
+ char *utf8_str = NULL, utf8_name[MXNAME], ascii_name[MXNAME];
+#endif
#ifdef WITH_IDN
result = dns_name_settotextfilter(output_filter);
check_result(result, "dns_name_settotextfilter");
#endif
-
+#ifdef WITH_LIBIDN
+ result = dns_name_settotextfilter (output_filter);
+ check_result(result, "dns_name_settotextfilter");
+#endif
REQUIRE(lookup != NULL);
INSIST(!free_now);
@@ -1782,6 +1811,16 @@ setup_lookup(dig_lookup_t *lookup) {
mr = idn_encodename(IDN_LOCALCONV | IDN_DELIMMAP, lookup->textname,
utf8_textname, sizeof(utf8_textname));
idn_check_result(mr, "convert textname to UTF-8");
+#elif defined (WITH_LIBIDN)
+ result = libidn_locale_to_utf8 (lookup->textname, &utf8_str);
+ check_result (result, "converting textname to UTF-8");
+ len = strlen (utf8_str);
+ if (len < MXNAME) {
+ (void) strcpy (utf8_name, utf8_str);
+ } else {
+ fatal ("Too long name");
+ }
+ isc_mem_free (mctx, utf8_str);
#endif
/*
@@ -1801,6 +1840,15 @@ setup_lookup(dig_lookup_t *lookup) {
lookup->origin = ISC_LIST_HEAD(search_list);
lookup->need_search = ISC_FALSE;
}
+#elif defined (WITH_LIBIDN)
+ if ((count_dots(utf8_name) >= ndots) || !usesearch) {
+ lookup->origin = NULL; /* Force abs lookup */
+ lookup->done_as_is = ISC_TRUE;
+ lookup->need_search = usesearch;
+ } else if (lookup->origin == NULL && usesearch) {
+ lookup->origin = ISC_LIST_HEAD(search_list);
+ lookup->need_search = ISC_FALSE;
+ }
#else
if ((count_dots(lookup->textname) >= ndots) || !usesearch) {
lookup->origin = NULL; /* Force abs lookup */
@@ -1827,6 +1875,20 @@ setup_lookup(dig_lookup_t *lookup) {
IDN_IDNCONV | IDN_LENCHECK, utf8_textname,
idn_textname, sizeof(idn_textname));
idn_check_result(mr, "convert UTF-8 textname to IDN encoding");
+#elif defined (WITH_LIBIDN)
+ if (lookup->origin != NULL) {
+ result = libidn_locale_to_utf8 (lookup->origin->origin, &utf8_str);
+ check_result (result, "convert origin to UTF-8");
+ if (len + strlen (utf8_str) + 1 < MXNAME) {
+ utf8_name[len++] = '.';
+ (void) strcpy (utf8_name + len, utf8_str);
+ } else {
+ fatal ("Too long name + origin");
+ }
+ isc_mem_free (mctx, utf8_str);
+ }
+
+ result = libidn_utf8_to_ascii (utf8_name, ascii_name);
#else
if (lookup->origin != NULL) {
debug("trying origin %s", lookup->origin->origin);
@@ -1883,6 +1945,14 @@ setup_lookup(dig_lookup_t *lookup) {
dns_rootname,
ISC_FALSE,
&lookup->namebuf);
+#elif defined (WITH_LIBIDN)
+ len = strlen (ascii_name);
+ isc_buffer_init(&b, ascii_name, len);
+ isc_buffer_add(&b, len);
+ result = dns_name_fromtext(lookup->name, &b,
+ dns_rootname,
+ ISC_FALSE,
+ &lookup->namebuf);
#else
len = strlen(lookup->textname);
isc_buffer_init(&b, lookup->textname, len);
@@ -3310,7 +3380,7 @@ destroy_libs(void) {
void * ptr;
dig_message_t *chase_msg;
#endif
-#ifdef WITH_IDN
+#if defined (WITH_IDN) || defined (WITH_LIBIDN)
isc_result_t result;
#endif
@@ -3349,6 +3419,10 @@ destroy_libs(void) {
result = dns_name_settotextfilter(NULL);
check_result(result, "dns_name_settotextfilter");
#endif
+#ifdef WITH_LIBIDN
+ result = dns_name_settotextfilter (NULL);
+ check_result(result, "clearing dns_name_settotextfilter");
+#endif
dns_name_destroy();
if (commctx != NULL) {
@@ -3525,6 +3599,79 @@ idn_check_result(idn_result_t r, const c
}
}
#endif /* WITH_IDN */
+#ifdef WITH_LIBIDN
+/* If stringprep_locale_to_utf8 fails simple copy string */
+static isc_result_t
+libidn_locale_to_utf8 (const char *from, char **to) {
+ char *utf8_str;
+
+ utf8_str = stringprep_locale_to_utf8 (from);
+ if (utf8_str == NULL) {
+ *to = isc_mem_allocate (mctx, strlen (from) + 1);
+ if (*to == NULL)
+ return (ISC_R_NOMEMORY);
+ (void) strcpy (*to, from);
+ } else {
+ *to = isc_mem_allocate (mctx, strlen (utf8_str) + 1);
+ if (*to == NULL)
+ return (ISC_R_NOMEMORY);
+ (void) strcpy (*to, utf8_str);
+ free (utf8_str);
+ }
+ return (ISC_R_SUCCESS);
+}
+static isc_result_t
+libidn_utf8_to_ascii (const char *from, char *to) {
+ char *ascii;
+
+ if (idna_to_ascii_8z (from, &ascii, 0) != IDNA_SUCCESS)
+ return (ISC_R_FAILURE);
+
+ (void) strcpy (to, ascii);
+ free (ascii);
+ return (ISC_R_SUCCESS);
+}
+/* based on idnkit's code*/
+static isc_result_t
+output_filter (isc_buffer_t *buffer, unsigned int used_org,
+ isc_boolean_t absolute) {
+ char tmp1[MXNAME], *tmp2;
+ size_t fromlen, tolen;
+ isc_boolean_t end_with_dot;
+
+ fromlen = isc_buffer_usedlength(buffer) - used_org;
+ if (fromlen >= MXNAME)
+ return (ISC_R_SUCCESS);
+ memcpy(tmp1, (char *)isc_buffer_base(buffer) + used_org, fromlen);
+ end_with_dot = (tmp1[fromlen - 1] == '.') ? ISC_TRUE : ISC_FALSE;
+ if (absolute && !end_with_dot) {
+ fromlen++;
+ if (fromlen >= MXNAME)
+ return (ISC_R_SUCCESS);
+ tmp1[fromlen - 1] = '.';
+ }
+ tmp1[fromlen] = '\0';
+
+ if (idna_to_unicode_lzlz (tmp1, &tmp2, 0) != IDNA_SUCCESS)
+ return (ISC_R_SUCCESS);
+
+ (void) strcpy (tmp1, tmp2);
+ free (tmp2);
+
+ tolen = strlen(tmp1);
+ if (absolute && !end_with_dot && tmp1[tolen - 1] == '.')
+ tolen--;
+
+ if (isc_buffer_length(buffer) < used_org + tolen)
+ return (ISC_R_NOSPACE);
+
+ isc_buffer_subtract(buffer, isc_buffer_usedlength(buffer) - used_org);
+ memcpy(isc_buffer_used(buffer), tmp1, tolen);
+ isc_buffer_add(buffer, tolen);
+
+ return (ISC_R_SUCCESS);
+}
+#endif /* WITH_LIBIDN*/
#ifdef DIG_SIGCHASE
void

221
bind-9.5-libidn2.patch Normal file
View file

@ -0,0 +1,221 @@
diff -up bind-9.5.0b1/bin/dig/dighost.c.libidn2 bind-9.5.0b1/bin/dig/dighost.c
--- bind-9.5.0b1/bin/dig/dighost.c.libidn2 2007-12-10 13:12:26.000000000 +0100
+++ bind-9.5.0b1/bin/dig/dighost.c 2007-12-10 14:21:09.000000000 +0100
@@ -153,7 +153,7 @@ int idnoptions = 0;
#endif
#ifdef WITH_LIBIDN
-static isc_result_t libidn_locale_to_utf8 (const char* from, char **to);
+static isc_result_t libidn_locale_to_utf8 (const char* from, char *to);
static isc_result_t libidn_utf8_to_ascii (const char* from, char *to);
static isc_result_t output_filter (isc_buffer_t *buffer,
unsigned int used_org,
@@ -1764,17 +1764,13 @@ setup_lookup(dig_lookup_t *lookup) {
char utf8_textname[MXNAME], utf8_origin[MXNAME], idn_textname[MXNAME];
#endif
#ifdef WITH_LIBIDN
- char *utf8_str = NULL, utf8_name[MXNAME], ascii_name[MXNAME];
+ char utf8_str[MXNAME], utf8_name[MXNAME], ascii_name[MXNAME];
#endif
-#ifdef WITH_IDN
+#if defined (WITH_IDN) || defined (WITH_LIBIDN)
result = dns_name_settotextfilter(output_filter);
check_result(result, "dns_name_settotextfilter");
#endif
-#ifdef WITH_LIBIDN
- result = dns_name_settotextfilter (output_filter);
- check_result(result, "dns_name_settotextfilter");
-#endif
REQUIRE(lookup != NULL);
INSIST(!free_now);
@@ -1812,15 +1808,13 @@ setup_lookup(dig_lookup_t *lookup) {
utf8_textname, sizeof(utf8_textname));
idn_check_result(mr, "convert textname to UTF-8");
#elif defined (WITH_LIBIDN)
- result = libidn_locale_to_utf8 (lookup->textname, &utf8_str);
- check_result (result, "converting textname to UTF-8");
+ result = libidn_locale_to_utf8 (lookup->textname, utf8_str);
+ check_result (result, "convert textname to UTF-8");
len = strlen (utf8_str);
- if (len < MXNAME) {
+ if (len < MXNAME)
(void) strcpy (utf8_name, utf8_str);
- } else {
+ else
fatal ("Too long name");
- }
- isc_mem_free (mctx, utf8_str);
#endif
/*
@@ -1833,24 +1827,11 @@ setup_lookup(dig_lookup_t *lookup) {
if (lookup->new_search) {
#ifdef WITH_IDN
if ((count_dots(utf8_textname) >= ndots) || !usesearch) {
- lookup->origin = NULL; /* Force abs lookup */
- lookup->done_as_is = ISC_TRUE;
- lookup->need_search = usesearch;
- } else if (lookup->origin == NULL && usesearch) {
- lookup->origin = ISC_LIST_HEAD(search_list);
- lookup->need_search = ISC_FALSE;
- }
#elif defined (WITH_LIBIDN)
if ((count_dots(utf8_name) >= ndots) || !usesearch) {
- lookup->origin = NULL; /* Force abs lookup */
- lookup->done_as_is = ISC_TRUE;
- lookup->need_search = usesearch;
- } else if (lookup->origin == NULL && usesearch) {
- lookup->origin = ISC_LIST_HEAD(search_list);
- lookup->need_search = ISC_FALSE;
- }
#else
if ((count_dots(lookup->textname) >= ndots) || !usesearch) {
+#endif
lookup->origin = NULL; /* Force abs lookup */
lookup->done_as_is = ISC_TRUE;
lookup->need_search = usesearch;
@@ -1858,7 +1839,6 @@ setup_lookup(dig_lookup_t *lookup) {
lookup->origin = ISC_LIST_HEAD(search_list);
lookup->need_search = ISC_FALSE;
}
-#endif
}
#ifdef WITH_IDN
@@ -1877,15 +1857,12 @@ setup_lookup(dig_lookup_t *lookup) {
idn_check_result(mr, "convert UTF-8 textname to IDN encoding");
#elif defined (WITH_LIBIDN)
if (lookup->origin != NULL) {
- result = libidn_locale_to_utf8 (lookup->origin->origin, &utf8_str);
+ result = libidn_locale_to_utf8 (lookup->origin->origin, utf8_str);
check_result (result, "convert origin to UTF-8");
- if (len + strlen (utf8_str) + 1 < MXNAME) {
- utf8_name[len++] = '.';
+ if (len + strlen (utf8_str) < MXNAME)
(void) strcpy (utf8_name + len, utf8_str);
- } else {
+ else
fatal ("Too long name + origin");
- }
- isc_mem_free (mctx, utf8_str);
}
result = libidn_utf8_to_ascii (utf8_name, ascii_name);
@@ -3600,76 +3577,85 @@ idn_check_result(idn_result_t r, const c
}
#endif /* WITH_IDN */
#ifdef WITH_LIBIDN
-/* If stringprep_locale_to_utf8 fails simple copy string */
static isc_result_t
-libidn_locale_to_utf8 (const char *from, char **to) {
+libidn_locale_to_utf8 (const char *from, char *to) {
char *utf8_str;
+ debug ("libidn_locale_to_utf8");
utf8_str = stringprep_locale_to_utf8 (from);
- if (utf8_str == NULL) {
- *to = isc_mem_allocate (mctx, strlen (from) + 1);
- if (*to == NULL)
- return (ISC_R_NOMEMORY);
- (void) strcpy (*to, from);
- } else {
- *to = isc_mem_allocate (mctx, strlen (utf8_str) + 1);
- if (*to == NULL)
- return (ISC_R_NOMEMORY);
- (void) strcpy (*to, utf8_str);
+ if (utf8_str != NULL) {
+ (void) strcpy (to, utf8_str);
free (utf8_str);
+ return ISC_R_SUCCESS;
}
- return (ISC_R_SUCCESS);
+
+ debug ("libidn_locale_to_utf8: failure");
+ return ISC_R_FAILURE;
}
static isc_result_t
libidn_utf8_to_ascii (const char *from, char *to) {
char *ascii;
+ int iresult;
- if (idna_to_ascii_8z (from, &ascii, 0) != IDNA_SUCCESS)
- return (ISC_R_FAILURE);
+ debug ("libidn_utf8_to_ascii");
+ iresult = idna_to_ascii_8z (from, &ascii, 0);
+ if (iresult != IDNA_SUCCESS) {
+ debug ("idna_to_ascii_8z: %s", idna_strerror (iresult));
+ return ISC_R_FAILURE;
+ }
(void) strcpy (to, ascii);
free (ascii);
- return (ISC_R_SUCCESS);
+ return ISC_R_SUCCESS;
}
-/* based on idnkit's code*/
+
static isc_result_t
output_filter (isc_buffer_t *buffer, unsigned int used_org,
isc_boolean_t absolute) {
+
char tmp1[MXNAME], *tmp2;
size_t fromlen, tolen;
isc_boolean_t end_with_dot;
+ int iresult;
+
+ debug ("output_filter");
- fromlen = isc_buffer_usedlength(buffer) - used_org;
+ fromlen = isc_buffer_usedlength (buffer) - used_org;
if (fromlen >= MXNAME)
- return (ISC_R_SUCCESS);
- memcpy(tmp1, (char *)isc_buffer_base(buffer) + used_org, fromlen);
+ return ISC_R_SUCCESS;
+ memcpy (tmp1, (char *) isc_buffer_base (buffer) + used_org, fromlen);
end_with_dot = (tmp1[fromlen - 1] == '.') ? ISC_TRUE : ISC_FALSE;
if (absolute && !end_with_dot) {
fromlen++;
if (fromlen >= MXNAME)
- return (ISC_R_SUCCESS);
+ return ISC_R_SUCCESS;
tmp1[fromlen - 1] = '.';
}
tmp1[fromlen] = '\0';
- if (idna_to_unicode_lzlz (tmp1, &tmp2, 0) != IDNA_SUCCESS)
- return (ISC_R_SUCCESS);
+ iresult = idna_to_unicode_8z8z (tmp1, &tmp2, 0);
+ if (iresult != IDNA_SUCCESS) {
+ debug ("output_filter: %s", idna_strerror (iresult));
+ return ISC_R_SUCCESS;
+ }
(void) strcpy (tmp1, tmp2);
free (tmp2);
- tolen = strlen(tmp1);
+ tolen = strlen (tmp1);
if (absolute && !end_with_dot && tmp1[tolen - 1] == '.')
tolen--;
- if (isc_buffer_length(buffer) < used_org + tolen)
- return (ISC_R_NOSPACE);
+ if (isc_buffer_length (buffer) < used_org + tolen)
+ return ISC_R_NOSPACE;
+
+ debug ("%s", tmp1);
- isc_buffer_subtract(buffer, isc_buffer_usedlength(buffer) - used_org);
- memcpy(isc_buffer_used(buffer), tmp1, tolen);
- isc_buffer_add(buffer, tolen);
+ isc_buffer_subtract (buffer, isc_buffer_usedlength (buffer) - used_org);
+ memcpy (isc_buffer_used (buffer), tmp1, tolen);
+ isc_buffer_add (buffer, tolen);
- return (ISC_R_SUCCESS);
+ return ISC_R_SUCCESS;
}
#endif /* WITH_LIBIDN*/

21
bind-9.5-libidn3.patch Normal file
View file

@ -0,0 +1,21 @@
diff -up bind-9.5.0b1/bin/dig/dighost.c.libidn3 bind-9.5.0b1/bin/dig/dighost.c
--- bind-9.5.0b1/bin/dig/dighost.c.libidn3 2007-12-20 13:24:27.000000000 +0100
+++ bind-9.5.0b1/bin/dig/dighost.c 2007-12-20 13:27:10.000000000 +0100
@@ -1859,10 +1859,13 @@ setup_lookup(dig_lookup_t *lookup) {
if (lookup->origin != NULL) {
result = libidn_locale_to_utf8 (lookup->origin->origin, utf8_str);
check_result (result, "convert origin to UTF-8");
- if (len + strlen (utf8_str) < MXNAME)
- (void) strcpy (utf8_name + len, utf8_str);
- else
- fatal ("Too long name + origin");
+ if (len > 0 && utf8_name[len - 1] != '.') {
+ utf8_name[len++] = '.';
+ if (len + strlen (utf8_str) < MXNAME)
+ (void) strcpy (utf8_name + len, utf8_str);
+ else
+ fatal ("Too long name + origin");
+ }
}
result = libidn_utf8_to_ascii (utf8_name, ascii_name);

24
bind-9.5-overflow.patch Normal file
View file

@ -0,0 +1,24 @@
diff -up bind-9.5.0a5/lib/isc/pthreads/condition.c.overflow bind-9.5.0a5/lib/isc/pthreads/condition.c
--- bind-9.5.0a5/lib/isc/pthreads/condition.c.overflow 2007-07-17 07:53:59.000000000 +0200
+++ bind-9.5.0a5/lib/isc/pthreads/condition.c 2007-07-17 07:55:08.000000000 +0200
@@ -43,7 +43,7 @@ isc_condition_waituntil(isc_condition_t
* POSIX defines a timespec's tv_sec as time_t.
*/
result = isc_time_secondsastimet(t, &ts.tv_sec);
- if (result != ISC_R_SUCCESS)
+ if (result != ISC_R_RANGE && result != ISC_R_SUCCESS)
return (result);
/*!
diff -up bind-9.5.0a5/lib/isc/unix/time.c.overflow bind-9.5.0a5/lib/isc/unix/time.c
--- bind-9.5.0a5/lib/isc/unix/time.c.overflow 2007-02-14 01:27:27.000000000 +0100
+++ bind-9.5.0a5/lib/isc/unix/time.c 2007-07-17 07:53:08.000000000 +0200
@@ -379,6 +379,9 @@ isc_time_secondsastimet(const isc_time_t
* (Let's hope the compiler got the actual test right.)
*/
UNUSED(i);
+
+ /* Means that t->seconds > maximum value in time_t and we have int time_t */
+ seconds = INT_MAX;
return (ISC_R_RANGE);
}

172
bind-9.5-recv-race.patch Normal file
View file

@ -0,0 +1,172 @@
diff -up bind-9.5.0b2/lib/isc/unix/socket.c.recv bind-9.5.0b2/lib/isc/unix/socket.c
--- bind-9.5.0b2/lib/isc/unix/socket.c.recv 2008-04-10 16:45:33.000000000 +0200
+++ bind-9.5.0b2/lib/isc/unix/socket.c 2008-04-10 17:00:46.000000000 +0200
@@ -261,10 +261,10 @@ static isc_result_t allocate_socket(isc_
static void destroy(isc_socket_t **);
static void internal_accept(isc_task_t *, isc_event_t *);
static void internal_connect(isc_task_t *, isc_event_t *);
-static void internal_recv(isc_task_t *, isc_event_t *);
+static void internal_recv(isc_event_t *);
static void internal_send(isc_task_t *, isc_event_t *);
static void internal_fdwatch_write(isc_task_t *, isc_event_t *);
-static void internal_fdwatch_read(isc_task_t *, isc_event_t *);
+static void internal_fdwatch_read(isc_event_t *);
static void process_cmsg(isc_socket_t *, struct msghdr *, isc_socketevent_t *);
static void build_msghdr_send(isc_socket_t *, isc_socketevent_t *,
struct msghdr *, struct iovec *, size_t *);
@@ -1830,7 +1830,7 @@ isc_socket_detach(isc_socket_t **socketp
*
* The socket and manager must be locked before calling this function.
*/
-static void
+static isc_boolean_t
dispatch_recv(isc_socket_t *sock) {
intev_t *iev;
isc_socketevent_t *ev;
@@ -1841,7 +1841,7 @@ dispatch_recv(isc_socket_t *sock) {
if (sock->type != isc_sockettype_fdwatch) {
ev = ISC_LIST_HEAD(sock->recv_list);
if (ev == NULL)
- return;
+ return ISC_FALSE;
socket_log(sock, NULL, EVENT, NULL, 0, 0,
"dispatch_recv: event %p -> task %p",
ev, ev->ev_sender);
@@ -1855,13 +1855,16 @@ dispatch_recv(isc_socket_t *sock) {
sock->references++;
iev->ev_sender = sock;
+ iev->ev_arg = sock;
if (sock->type == isc_sockettype_fdwatch)
- iev->ev_action = internal_fdwatch_read;
+ internal_fdwatch_read (iev);
else
- iev->ev_action = internal_recv;
- iev->ev_arg = sock;
+ internal_recv (iev);
- isc_task_send(sender, (isc_event_t **)&iev);
+ if (sock->references == 0)
+ return ISC_TRUE;
+
+ return ISC_FALSE;
}
static void
@@ -2228,7 +2231,7 @@ internal_accept(isc_task_t *me, isc_even
}
static void
-internal_recv(isc_task_t *me, isc_event_t *ev) {
+internal_recv(isc_event_t *ev) {
isc_socketevent_t *dev;
isc_socket_t *sock;
@@ -2237,21 +2240,13 @@ internal_recv(isc_task_t *me, isc_event_
sock = ev->ev_sender;
INSIST(VALID_SOCKET(sock));
- LOCK(&sock->lock);
- socket_log(sock, NULL, IOEVENT,
- isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALRECV,
- "internal_recv: task %p got event %p", me, ev);
-
INSIST(sock->pending_recv == 1);
sock->pending_recv = 0;
INSIST(sock->references > 0);
sock->references--; /* the internal event is done with this socket */
- if (sock->references == 0) {
- UNLOCK(&sock->lock);
- destroy(&sock);
+ if (sock->references == 0)
return;
- }
/*
* Try to do as much I/O as possible on this socket. There are no
@@ -2289,7 +2284,6 @@ internal_recv(isc_task_t *me, isc_event_
if (!ISC_LIST_EMPTY(sock->recv_list))
select_poke(sock->manager, sock->fd, SELECT_POKE_READ);
- UNLOCK(&sock->lock);
}
static void
@@ -2388,7 +2382,7 @@ internal_fdwatch_write(isc_task_t *me, i
}
static void
-internal_fdwatch_read(isc_task_t *me, isc_event_t *ev) {
+internal_fdwatch_read(isc_event_t *ev) {
isc_socket_t *sock;
int more_data;
@@ -2400,31 +2394,19 @@ internal_fdwatch_read(isc_task_t *me, is
sock = (isc_socket_t *)ev->ev_sender;
INSIST(VALID_SOCKET(sock));
- LOCK(&sock->lock);
- socket_log(sock, NULL, IOEVENT,
- isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALRECV,
- "internal_fdwatch_read: task %p got event %p", me, ev);
-
INSIST(sock->pending_recv == 1);
- UNLOCK(&sock->lock);
- more_data = (sock->fdwatchcb)(me, sock, sock->fdwatcharg);
- LOCK(&sock->lock);
+ INSIST(0); /* We should not be here */
sock->pending_recv = 0;
INSIST(sock->references > 0);
sock->references--; /* the internal event is done with this socket */
- if (sock->references == 0) {
- UNLOCK(&sock->lock);
- destroy(&sock);
+ if (sock->references == 0)
return;
- }
if (more_data)
select_poke(sock->manager, sock->fd, SELECT_POKE_READ);
-
- UNLOCK(&sock->lock);
}
static void
@@ -2434,6 +2416,7 @@ process_fds(isc_socketmgr_t *manager, in
int i;
isc_socket_t *sock;
isc_boolean_t unlock_sock;
+ isc_boolean_t destroy_sock;
REQUIRE(maxfd <= (int)FD_SETSIZE);
@@ -2462,6 +2445,7 @@ process_fds(isc_socketmgr_t *manager, in
sock = manager->fds[i];
unlock_sock = ISC_FALSE;
+ destroy_sock = ISC_FALSE;
if (FD_ISSET(i, readfds)) {
if (sock == NULL) {
FD_CLR(i, &manager->read_fds);
@@ -2473,7 +2457,7 @@ process_fds(isc_socketmgr_t *manager, in
if (sock->listener)
dispatch_accept(sock);
else
- dispatch_recv(sock);
+ destroy_sock = dispatch_recv(sock);
}
FD_CLR(i, &manager->read_fds);
}
@@ -2497,6 +2481,8 @@ process_fds(isc_socketmgr_t *manager, in
}
if (unlock_sock)
UNLOCK(&sock->lock);
+ if (destroy_sock)
+ destroy(&sock);
}
}

224
bind-9.5-sdb.patch Normal file
View file

@ -0,0 +1,224 @@
diff -up bind-9.5.0b2/bin/named-sdb/main.c.sdb bind-9.5.0b2/bin/named/main-sdb.c
--- bind-9.5.0b2/bin/named-sdb/main.c.sdb 2008-02-11 17:32:43.000000000 +0100
+++ bind-9.5.0b2/bin/named-sdb/main.c 2008-02-11 17:32:43.000000000 +0100
@@ -72,6 +72,9 @@
* Include header files for database drivers here.
*/
/* #include "xxdb.h" */
+#include "ldapdb.h"
+#include "pgsqldb.h"
+#include "dirdb.h"
/*
* Include DLZ drivers if appropriate.
@@ -641,6 +644,10 @@ setup(void) {
ns_main_earlyfatal("isc_app_start() failed: %s",
isc_result_totext(result));
+ ldapdb_clear();
+ pgsqldb_clear();
+ dirdb_clear();
+
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
ISC_LOG_NOTICE, "starting BIND %s%s", ns_g_version,
saved_command_line);
@@ -702,6 +709,57 @@ setup(void) {
isc_result_totext(result));
#endif
+ result = ldapdb_init();
+ if (result != ISC_R_SUCCESS)
+ {
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_ERROR,
+ "SDB ldap module initialisation failed: %s.",
+ isc_result_totext(result)
+ );
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_ERROR,
+ "SDB ldap zone database will be unavailable."
+ );
+ }else
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_NOTICE, "SDB ldap zone database module loaded."
+ );
+
+ result = pgsqldb_init();
+ if (result != ISC_R_SUCCESS)
+ {
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_ERROR,
+ "SDB pgsql module initialisation failed: %s.",
+ isc_result_totext(result)
+ );
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_ERROR,
+ "SDB pgsql zone database will be unavailable."
+ );
+ }else
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_NOTICE, "SDB postgreSQL DB zone database module loaded."
+ );
+
+ result = dirdb_init();
+ if (result != ISC_R_SUCCESS)
+ {
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_ERROR,
+ "SDB directory DB module initialisation failed: %s.",
+ isc_result_totext(result)
+ );
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_ERROR,
+ "SDB directory DB zone database will be unavailable."
+ );
+ }else
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_NOTICE, "SDB directory DB zone database module loaded."
+ );
+
ns_server_create(ns_g_mctx, &ns_g_server);
}
@@ -727,6 +785,10 @@ cleanup(void) {
dns_name_destroy();
+ ldapdb_clear();
+ pgsqldb_clear();
+ dirdb_clear();
+
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
ISC_LOG_NOTICE, "exiting");
ns_log_shutdown();
diff -up bind-9.5.0b2/configure.in.sdb bind-9.5.0b2/configure.in
--- bind-9.5.0b2/configure.in.sdb 2008-02-14 14:14:55.000000000 +0100
+++ bind-9.5.0b2/configure.in 2008-02-14 14:15:34.000000000 +0100
@@ -2761,6 +2761,8 @@ AC_CONFIG_FILES([
bin/check/Makefile
bin/named/Makefile
bin/named/unix/Makefile
+ bin/named-sdb/Makefile
+ bin/named-sdb/unix/Makefile
bin/rndc/Makefile
bin/rndc/unix/Makefile
bin/dig/Makefile
@@ -2782,6 +2784,7 @@ AC_CONFIG_FILES([
bin/tests/system/tkey/Makefile
bin/tests/headerdep_test.sh
bin/dnssec/Makefile
+ bin/sdb_tools/Makefile
doc/Makefile
doc/arm/Makefile
doc/misc/Makefile
diff -up bind-9.5.0b2/bin/named-sdb/Makefile.in.sdb bind-9.5.0b2/bin/named-sdb/Makefile.in
--- bind-9.5.0b2/bin/named-sdb/Makefile.in.sdb 2008-02-14 14:16:10.000000000 +0100
+++ bind-9.5.0b2/bin/named-sdb/Makefile.in 2008-02-14 14:18:45.000000000 +0100
@@ -26,10 +26,10 @@ top_srcdir = @top_srcdir@
#
# Add database drivers here.
#
-DBDRIVER_OBJS =
-DBDRIVER_SRCS =
+DBDRIVER_OBJS = ldapdb.o pgsqldb.o dirdb.o
+DBDRIVER_SRCS = ldapdb.c pgsqldb.c dirdb.c
DBDRIVER_INCLUDES =
-DBDRIVER_LIBS =
+DBDRIVER_LIBS = -lldap -llber -lpq
DLZ_DRIVER_DIR = ${top_srcdir}/contrib/dlz/drivers
@@ -70,7 +70,7 @@ LIBS = ${LWRESLIBS} ${DNSLIBS} ${BIND9L
SUBDIRS = unix
-TARGETS = named@EXEEXT@ lwresd@EXEEXT@
+TARGETS = named-sdb@EXEEXT@
OBJS = builtin.o client.o config.o control.o \
controlconf.o interfacemgr.o \
@@ -118,7 +118,7 @@ config.o: config.c
-DNS_LOCALSTATEDIR=\"${localstatedir}\" \
-c ${srcdir}/config.c
-named@EXEEXT@: ${OBJS} ${UOBJS} ${DEPLIBS}
+named-sdb@EXEEXT@: ${OBJS} ${UOBJS} ${DEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
${OBJS} ${UOBJS} ${LIBS}
@@ -142,14 +142,8 @@ server.o: bind9.xsl.h
installdirs:
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir}
- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man5
- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
-install:: named@EXEEXT@ lwresd@EXEEXT@ installdirs
- ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named@EXEEXT@ ${DESTDIR}${sbindir}
- (cd ${DESTDIR}${sbindir}; rm -f lwresd@EXEEXT@; @LN@ named@EXEEXT@ lwresd@EXEEXT@)
- ${INSTALL_DATA} ${srcdir}/named.8 ${DESTDIR}${mandir}/man8
- ${INSTALL_DATA} ${srcdir}/lwresd.8 ${DESTDIR}${mandir}/man8
- ${INSTALL_DATA} ${srcdir}/named.conf.5 ${DESTDIR}${mandir}/man5
+install:: named-sdb@EXEEXT@ installdirs
+ ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-sdb@EXEEXT@ ${DESTDIR}${sbindir}
@DLZ_DRIVER_RULES@
diff -up bind-9.5.0b2/bin/Makefile.in.sdb bind-9.5.0b2/bin/Makefile.in
--- bind-9.5.0b2/bin/Makefile.in.sdb 2008-02-14 14:15:42.000000000 +0100
+++ bind-9.5.0b2/bin/Makefile.in 2008-02-14 14:15:55.000000000 +0100
@@ -19,7 +19,7 @@ srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
-SUBDIRS = named rndc dig dnssec tests nsupdate check
+SUBDIRS = named named-sdb rndc dig dnssec tests nsupdate check sdb_tools
TARGETS =
@BIND9_MAKE_RULES@
diff -up bind-9.5.0b2/bin/named/Makefile.in.sdb bind-9.5.0b2/bin/named/Makefile.in
--- bind-9.5.0b2/bin/named/Makefile.in.sdb 2008-02-14 14:19:39.000000000 +0100
+++ bind-9.5.0b2/bin/named/Makefile.in 2008-02-14 14:20:18.000000000 +0100
@@ -43,7 +43,7 @@ CINCLUDES = -I${srcdir}/include -I${srcd
${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} ${ISC_INCLUDES} \
${DLZDRIVER_INCLUDES} ${DBDRIVER_INCLUDES}
-CDEFINES = @USE_DLZ@
+CDEFINES =
CWARNINGS =
@@ -66,7 +66,7 @@ DEPLIBS = ${LWRESDEPLIBS} ${DNSDEPLIBS}
LIBS = ${LWRESLIBS} ${DNSLIBS} ${BIND9LIBS} \
${ISCCFGLIBS} ${ISCCCLIBS} ${ISCLIBS} \
- ${DLZDRIVER_LIBS} ${DBDRIVER_LIBS} @LIBS@
+ @LIBS@
SUBDIRS = unix
@@ -79,8 +79,7 @@ OBJS = builtin.o client.o config.o
tkeyconf.o tsigconf.o update.o xfrout.o \
zoneconf.o \
lwaddr.o lwresd.o lwdclient.o lwderror.o lwdgabn.o \
- lwdgnba.o lwdgrbn.o lwdnoop.o lwsearch.o \
- ${DLZDRIVER_OBJS} ${DBDRIVER_OBJS}
+ lwdgnba.o lwdgrbn.o lwdnoop.o lwsearch.o
UOBJS = unix/os.o
@@ -91,8 +90,7 @@ SRCS = builtin.c client.c config.c cont
tkeyconf.c tsigconf.c update.c xfrout.c \
zoneconf.c \
lwaddr.c lwresd.c lwdclient.c lwderror.c lwdgabn.c \
- lwdgnba.c lwdgrbn.c lwdnoop.c lwsearch.c \
- ${DLZDRIVER_SRCS} ${DBDRIVER_SRCS}
+ lwdgnba.c lwdgrbn.c lwdnoop.c lwsearch.c
MANPAGES = named.8 lwresd.8 named.conf.5
@@ -151,5 +149,3 @@ install:: named@EXEEXT@ lwresd@EXEEXT@ i
${INSTALL_DATA} ${srcdir}/named.8 ${DESTDIR}${mandir}/man8
${INSTALL_DATA} ${srcdir}/lwresd.8 ${DESTDIR}${mandir}/man8
${INSTALL_DATA} ${srcdir}/named.conf.5 ${DESTDIR}${mandir}/man5
-
-@DLZ_DRIVER_RULES@

726
bind-9.5.0-dbus.patch Normal file
View file

@ -0,0 +1,726 @@
--- bind-9.5.0a5/lib/isc/include/isc/socket.h.dbus 2007-02-13 03:49:08.000000000 +0100
+++ bind-9.5.0a5/lib/isc/include/isc/socket.h 2007-06-19 11:06:55.000000000 +0200
@@ -136,6 +136,10 @@ struct isc_socket_connev {
#define ISC_SOCKEVENT_NEWCONN (ISC_EVENTCLASS_SOCKET + 3)
#define ISC_SOCKEVENT_CONNECT (ISC_EVENTCLASS_SOCKET + 4)
+#define ISC_SOCKEVENT_READ_READY (ISC_EVENTCLASS_SOCKET + 5)
+#define ISC_SOCKEVENT_WRITE_READY (ISC_EVENTCLASS_SOCKET + 6)
+#define ISC_SOCKEVENT_SELECTED (ISC_EVENTCLASS_SOCKET + 7)
+
/*
* Internal events.
*/
@@ -147,6 +151,7 @@ typedef enum {
isc_sockettype_tcp = 2,
isc_sockettype_unix = 3,
isc_sockettype_fdwatch = 4,
+ isc_sockettype_fd = 8
} isc_sockettype_t;
/*@{*/
@@ -823,6 +828,54 @@ isc_socketmgr_renderxml(isc_socketmgr_t
#endif /* HAVE_LIBXML2 */
+isc_socketevent_t*
+isc_socket_fd_handle_reads( isc_socket_t *sock, isc_socketevent_t *dev );
+/* register the "dev" event to be sent when the isc_sockettype_fd sock
+ * was select()-ed for read. If there is already an event registered, it
+ * is returned, otherwise 0 is returned. If dev is 0, removes any existing
+ * registered event.
+ */
+
+isc_socketevent_t*
+isc_socket_fd_handle_writes( isc_socket_t *sock, isc_socketevent_t *dev );
+/* register the "dev" event to be sent when the isc_sockettype_fd sock
+ * was select()-ed for write. If there is already an event registered, it
+ * is returned, otherwise 0 is returned. If dev is 0, removes any existing
+ * registered event.
+ */
+
+isc_socketevent_t*
+isc_socket_fd_handle_selected( isc_socket_t *sock, isc_socketevent_t *dev );
+/* register the "dev" event to be sent when ALL isc_sockettype_fd sockets
+ * have been select()-ed . If there is already an event registered, it
+ * is returned, otherwise 0 is returned. If dev is 0, removes any existing
+ * registered event.
+ */
+
+isc_socketevent_t*
+isc_socket_fd_handle_reads( isc_socket_t *sock, isc_socketevent_t *dev );
+/* register the "dev" event to be sent when the isc_sockettype_fd sock
+ * was select()-ed for read. If there is already an event registered, it
+ * is returned, otherwise 0 is returned. If dev is 0, removes any existing
+ * registered event.
+ */
+
+isc_socketevent_t*
+isc_socket_fd_handle_writes( isc_socket_t *sock, isc_socketevent_t *dev );
+/* register the "dev" event to be sent when the isc_sockettype_fd sock
+ * was select()-ed for write. If there is already an event registered, it
+ * is returned, otherwise 0 is returned. If dev is 0, removes any existing
+ * registered event.
+ */
+
+isc_socketevent_t*
+isc_socket_fd_handle_selected( isc_socket_t *sock, isc_socketevent_t *dev );
+/* register the "dev" event to be sent when ALL isc_sockettype_fd sockets
+ * have been select()-ed . If there is already an event registered, it
+ * is returned, otherwise 0 is returned. If dev is 0, removes any existing
+ * registered event.
+ */
+
ISC_LANG_ENDDECLS
#endif /* ISC_SOCKET_H */
--- bind-9.5.0a5/lib/isc/unix/socket.c.dbus 2007-05-21 03:55:10.000000000 +0200
+++ bind-9.5.0a5/lib/isc/unix/socket.c 2007-06-19 11:14:48.000000000 +0200
@@ -176,6 +176,11 @@ struct isc_socket {
ISC_LIST(isc_socketevent_t) recv_list;
ISC_LIST(isc_socket_newconnev_t) accept_list;
isc_socket_connev_t *connect_ev;
+
+ /* these are used only by isc_sockettype_fd sockets:*/
+ isc_socketevent_t *read_ready_event;
+ isc_socketevent_t *write_ready_event;
+ isc_socketevent_t *selected_event;
/*
* Internal events. Posted when a descriptor is readable or
@@ -340,7 +345,7 @@ socket_log(isc_socket_t *sock, isc_socka
static void
wakeup_socket(isc_socketmgr_t *manager, int fd, int msg) {
- isc_socket_t *sock;
+ isc_socket_t *sock=0L;
/*
* This is a wakeup on a socket. If the socket is not in the
@@ -1341,6 +1346,9 @@ allocate_socket(isc_socketmgr_t *manager
sock->connected = 0;
sock->connecting = 0;
sock->bound = 0;
+ sock->read_ready_event = 0L;
+ sock->write_ready_event = 0L;
+ sock->selected_event = 0L;
/*
* initialize the lock
@@ -1499,6 +1507,8 @@ isc_socket_create(isc_socketmgr_t *manag
case isc_sockettype_fdwatch:
INSIST(type != isc_sockettype_fdwatch);
break;
+ case isc_sockettype_fd:
+ sock->fd = pf;
}
if (sock->fd == -1 && errno == EINTR && try++ < 42)
goto again;
@@ -1507,7 +1517,7 @@ isc_socket_create(isc_socketmgr_t *manag
/*
* Leave a space for stdio to work in.
*/
- if (sock->fd >= 0 && sock->fd < 20) {
+ if ( (type != isc_sockettype_fd) && (sock->fd >= 0 && sock->fd < 20) ) {
int new, tmp;
new = fcntl(sock->fd, F_DUPFD, 20);
tmp = errno;
@@ -1561,7 +1571,7 @@ isc_socket_create(isc_socketmgr_t *manag
}
}
- if (make_nonblock(sock->fd) != ISC_R_SUCCESS) {
+ if ((type != isc_sockettype_fd) && (make_nonblock(sock->fd) != ISC_R_SUCCESS)) {
(void)close(sock->fd);
free_socket(&sock);
return (ISC_R_UNEXPECTED);
@@ -1933,6 +1943,38 @@ dispatch_connect(isc_socket_t *sock) {
isc_task_send(ev->ev_sender, (isc_event_t **)&iev);
}
+static
+isc_event_t *dispatch_read_ready(isc_socketmgr_t *manager, isc_socket_t *sock)
+{
+ isc_event_t *dev = (isc_event_t*)sock->read_ready_event, *ev;
+
+ ev = isc_mem_get(manager->mctx, dev->ev_size);
+ memcpy(ev,dev,dev->ev_size);
+ ISC_LINK_INIT(ev,ev_link);
+ isc_task_send(dev->ev_sender, &ev );
+ return (isc_event_t *)sock->selected_event;
+}
+
+static
+isc_event_t *dispatch_write_ready(isc_socketmgr_t *manager,isc_socket_t *sock)
+{
+ isc_event_t *dev = (isc_event_t*)sock->write_ready_event, *ev;
+ ev = isc_mem_get(manager->mctx, dev->ev_size);
+ memcpy(ev,dev,dev->ev_size);
+ ISC_LINK_INIT(ev,ev_link);
+ isc_task_send(dev->ev_sender, &ev );
+ return (isc_event_t *)sock->selected_event;
+}
+
+static
+void dispatch_selected(isc_socketmgr_t *manager, isc_event_t *dev)
+{ isc_event_t *ev;
+ ev = isc_mem_get(manager->mctx, dev->ev_size);
+ memcpy(ev,dev,dev->ev_size);
+ ISC_LINK_INIT(ev,ev_link);
+ isc_task_send(dev->ev_sender, &ev );
+}
+
/*
* Dequeue an item off the given socket's read queue, set the result code
* in the done event to the one provided, and send it to the task it was
@@ -2420,6 +2462,7 @@ process_fds(isc_socketmgr_t *manager, in
int i;
isc_socket_t *sock;
isc_boolean_t unlock_sock;
+ isc_event_t *sock_selected = 0L;
REQUIRE(maxfd <= (int)FD_SETSIZE);
@@ -2456,11 +2499,15 @@ process_fds(isc_socketmgr_t *manager, in
unlock_sock = ISC_TRUE;
LOCK(&sock->lock);
if (!SOCK_DEAD(sock)) {
+ if( sock->type != isc_sockettype_fd )
+ {
if (sock->listener)
dispatch_accept(sock);
else
dispatch_recv(sock);
- }
+ }else
+ sock_selected = dispatch_read_ready(manager,sock);
+ }
FD_CLR(i, &manager->read_fds);
}
check_write:
@@ -2474,16 +2521,24 @@ process_fds(isc_socketmgr_t *manager, in
LOCK(&sock->lock);
}
if (!SOCK_DEAD(sock)) {
+ if( sock->type != isc_sockettype_fd )
+ {
if (sock->connecting)
dispatch_connect(sock);
else
dispatch_send(sock);
+ }else
+ sock_selected = dispatch_write_ready(manager,sock);
}
FD_CLR(i, &manager->write_fds);
}
if (unlock_sock)
UNLOCK(&sock->lock);
}
+ if( sock_selected != 0L )
+ {
+ dispatch_selected(manager, sock_selected);
+ }
}
#ifdef ISC_PLATFORM_USETHREADS
@@ -2502,7 +2557,7 @@ watcher(void *uap) {
int cc;
fd_set readfds;
fd_set writefds;
- int msg, fd;
+ int msg, fd = -1;
int maxfd;
char strbuf[ISC_STRERRORSIZE];
@@ -4165,3 +4220,56 @@ isc_socketmgr_renderxml(isc_socketmgr_t
UNLOCK(&mgr->lock);
}
#endif /* HAVE_LIBXML2 */
+
+isc_socketevent_t*
+isc_socket_fd_handle_reads( isc_socket_t *sock, isc_socketevent_t *dev )
+{
+ REQUIRE(VALID_SOCKET(sock));
+ if(dev != 0L)
+ {
+ sock->references=1;
+ sock->read_ready_event = dev;
+ select_poke(sock->manager, sock->fd, SELECT_POKE_READ);
+ }else
+ {
+ dev = sock->read_ready_event ;
+ sock->read_ready_event = 0L ;
+ }
+ return dev;
+}
+
+isc_socketevent_t*
+isc_socket_fd_handle_writes( isc_socket_t *sock, isc_socketevent_t *dev )
+{
+ REQUIRE(VALID_SOCKET(sock));
+ if(dev != 0L)
+ {
+ sock->references=1;
+ sock->write_ready_event = dev;
+ select_poke(sock->manager, sock->fd, SELECT_POKE_WRITE);
+ }else
+ {
+ dev = sock->write_ready_event;
+ sock->write_ready_event = 0L;
+ }
+ return dev;
+}
+
+isc_socketevent_t*
+isc_socket_fd_handle_selected( isc_socket_t *sock, isc_socketevent_t *dev )
+{
+ REQUIRE(VALID_SOCKET(sock));
+ if(dev != 0L)
+ {
+ sock->references=1;
+ sock->selected_event = dev;
+ }else
+ {
+ dev = sock->selected_event;
+ sock->selected_event = 0L;
+ sock->references=0;
+ destroy(&sock);
+ }
+ return dev;
+}
+
--- bind-9.5.0a5/lib/dns/forward.c.dbus 2005-07-12 03:00:15.000000000 +0200
+++ bind-9.5.0a5/lib/dns/forward.c 2007-06-19 11:04:17.000000000 +0200
@@ -197,3 +197,89 @@ auto_detach(void *data, void *arg) {
}
isc_mem_put(fwdtable->mctx, forwarders, sizeof(dns_forwarders_t));
}
+
+/***
+ *** new D-BUS Dynamic Forwarding Zones functions:
+ ***/
+isc_result_t
+dns_fwdtable_delete(dns_fwdtable_t *fwdtable, dns_name_t *name )
+{
+ isc_result_t result;
+
+ REQUIRE(VALID_FWDTABLE(fwdtable));
+
+ RWLOCK(&fwdtable->rwlock, isc_rwlocktype_write);
+
+ result = dns_rbt_deletename(fwdtable->table, name, ISC_FALSE);
+
+ RWUNLOCK(&fwdtable->rwlock, isc_rwlocktype_write);
+
+ return (result);
+}
+
+isc_result_t
+dns_fwdtable_find_closest(dns_fwdtable_t *fwdtable,
+ dns_name_t *name,
+ dns_name_t *foundname,
+ dns_forwarders_t **forwardersp)
+{
+ isc_result_t result;
+
+ REQUIRE(VALID_FWDTABLE(fwdtable));
+
+ RWLOCK(&fwdtable->rwlock, isc_rwlocktype_read);
+
+ result = dns_rbt_findname(fwdtable->table, name, 0, foundname,
+ (void **)forwardersp);
+
+ if(result == DNS_R_PARTIALMATCH)
+ result = ISC_R_SUCCESS;
+
+ RWUNLOCK(&fwdtable->rwlock, isc_rwlocktype_read);
+
+ return (result);
+}
+
+isc_result_t
+dns_fwdtable_find_exact(dns_fwdtable_t *fwdtable, dns_name_t *name,
+ dns_forwarders_t **forwardersp)
+{
+ isc_result_t result;
+
+ REQUIRE(VALID_FWDTABLE(fwdtable));
+
+ REQUIRE(forwardersp != 0L);
+
+ RWLOCK(&fwdtable->rwlock, isc_rwlocktype_read);
+
+ result = dns_rbt_findname(fwdtable->table, name, 0, NULL,
+ (void **)forwardersp);
+
+ if( result != ISC_R_SUCCESS )
+ *forwardersp = 0L;
+
+ RWUNLOCK(&fwdtable->rwlock, isc_rwlocktype_read);
+
+ return (result);
+}
+
+static
+void dns_fwdtable_traverse
+(
+ dns_name_t *name,
+ void *node_data,
+ void *cbp,
+ void *cb_arg
+)
+{
+ dns_fwdtable_callback_t cb = (dns_fwdtable_callback_t) cbp;
+
+ (*cb)( name, node_data, cb_arg);
+}
+
+void dns_fwdtable_foreach(dns_fwdtable_t *fwdtable, dns_fwdtable_callback_t cb, void *cb_arg )
+{
+ REQUIRE(VALID_FWDTABLE(fwdtable));
+
+ dns_rbt_traverse( fwdtable->table, dns_fwdtable_traverse, cb, cb_arg );
+}
--- bind-9.5.0a5/lib/dns/rbt.c.dbus 2005-10-13 03:19:12.000000000 +0200
+++ bind-9.5.0a5/lib/dns/rbt.c 2007-06-19 11:04:17.000000000 +0200
@@ -2175,6 +2175,47 @@ dns_rbt_printall(dns_rbt_t *rbt) {
dns_rbt_printtree(rbt->root, NULL, 0);
}
+static void
+dns_rbt_traverse_tree(dns_rbtnode_t *root, dns_rbt_traverse_callback_t cb, void *cb_arg1, void *cb_arg2 ) {
+/*
+ * This is used ONLY to traverse the forward table by dbus_mgr at the moment.
+ * Since the forward table is not likely to be large, this can be recursive.
+ */
+ dns_name_t name;
+ dns_offsets_t offsets;
+ char buf[DNS_NAME_MAXWIRE];
+ isc_buffer_t buffer;
+
+ if (root != NULL) {
+
+ if (DOWN(root))
+ dns_rbt_traverse_tree(DOWN(root), cb, cb_arg1, cb_arg2);
+
+ if( LEFT(root) != NULL )
+ dns_rbt_traverse_tree(LEFT(root), cb, cb_arg1, cb_arg2);
+
+ if( RIGHT(root) != NULL )
+ dns_rbt_traverse_tree(RIGHT(root), cb, cb_arg1, cb_arg2);
+
+ if( DATA(root) == 0L )
+ return;
+
+ dns_name_init(&name, offsets);
+ isc_buffer_init(&buffer, buf, DNS_NAME_MAXWIRE);
+ dns_name_setbuffer( &name, &buffer);
+ dns_rbt_fullnamefromnode(root, &name);
+
+ (*cb)(&name, DATA(root), cb_arg1, cb_arg2);
+ }
+}
+
+void dns_rbt_traverse( dns_rbt_t *rbt, dns_rbt_traverse_callback_t cb, void *cb_arg1, void *cb_arg2 )
+{
+ REQUIRE(VALID_RBT(rbt));
+
+ dns_rbt_traverse_tree( rbt->root, cb, cb_arg1, cb_arg2 );
+}
+
/*
* Chain Functions
*/
--- bind-9.5.0a5/lib/dns/include/dns/rbt.h.dbus 2006-12-22 02:59:43.000000000 +0100
+++ bind-9.5.0a5/lib/dns/include/dns/rbt.h 2007-06-19 11:04:17.000000000 +0200
@@ -911,6 +911,17 @@ dns_rbtnodechain_next(dns_rbtnodechain_t
} while (0)
#endif /* DNS_RBT_USEISCREFCOUNT */
+
+typedef void (*dns_rbt_traverse_callback_t)( dns_name_t *name,
+ void *node_data,
+ void *cb_arg1,
+ void *cb_arg2);
+
+void dns_rbt_traverse( dns_rbt_t *rbt, dns_rbt_traverse_callback_t cb, void *cb_arg1, void *cb_arg2 );
+/* tree traversal function (only used by D-BUS dynamic forwarding dbus_mgr at
+ * the moment)
+ */
+
ISC_LANG_ENDDECLS
#endif /* DNS_RBT_H */
--- bind-9.5.0a5/lib/dns/include/dns/forward.h.dbus 2006-12-22 02:59:43.000000000 +0100
+++ bind-9.5.0a5/lib/dns/include/dns/forward.h 2007-06-19 11:04:17.000000000 +0200
@@ -113,6 +113,37 @@ dns_fwdtable_destroy(dns_fwdtable_t **fw
* \li all memory associated with the forwarding table is freed.
*/
+
+/* These are ONLY used by dbus_mgr :
+ */
+
+isc_result_t
+dns_fwdtable_delete( dns_fwdtable_t *fwdtable, dns_name_t *name );
+/*
+ * Removes an entry from the forwarding table.
+ */
+
+isc_result_t
+dns_fwdtable_find_exact(dns_fwdtable_t *fwdtable, dns_name_t *name,
+ dns_forwarders_t **forwardersp);
+/*
+ * Finds an exact match for "name" in the forwarding table.
+ */
+
+isc_result_t
+dns_fwdtable_find_closest(dns_fwdtable_t *fwdtable, dns_name_t *name, dns_name_t *foundname,
+ dns_forwarders_t **forwardersp);
+/*
+ * Finds the closest match for "*name" in the forwarding table, returning
+ * the actual name matching in *name if different to *name passed in.
+ */
+
+typedef void (*dns_fwdtable_callback_t)( dns_name_t *, dns_forwarders_t *, void *);
+void dns_fwdtable_foreach(dns_fwdtable_t *fwdtable, dns_fwdtable_callback_t cb, void * );
+/* Invoke cb for each member of fwdtable
+ */
+
+
ISC_LANG_ENDDECLS
#endif /* DNS_FORWARD_H */
--- bind-9.5.0a5/bin/named/main.c.dbus 2007-05-21 05:46:41.000000000 +0200
+++ bind-9.5.0a5/bin/named/main.c 2007-06-19 11:04:17.000000000 +0200
@@ -248,7 +248,8 @@ usage(void) {
"usage: named [-4|-6] [-c conffile] [-d debuglevel] "
"[-f|-g] [-n number_of_cpus]\n"
" [-p port] [-s] [-t chrootdir] [-u username]\n"
- " [-m {usage|trace|record|size|mctx}]\n");
+ " [-m {usage|trace|record|size|mctx}]\n"
+ " [-D ]\n");
}
static void
@@ -356,7 +357,7 @@ parse_command_line(int argc, char *argv[
isc_commandline_errprint = ISC_FALSE;
while ((ch = isc_commandline_parse(argc, argv,
- "46c:C:d:fgi:lm:n:N:p:P:st:u:vx:")) != -1) {
+ "46c:C:d:fgi:lm:n:N:p:P:st:u:vx:D")) != -1) {
switch (ch) {
case '4':
if (disable4)
@@ -445,6 +446,9 @@ parse_command_line(int argc, char *argv[
case 'v':
printf("BIND %s\n", ns_g_version);
exit(0);
+ case 'D':
+ ns_g_dbus = 1;
+ break;
case '?':
usage();
if (isc_commandline_option == '?')
--- bind-9.5.0a5/bin/named/log.c.dbus 2006-12-22 02:44:59.000000000 +0100
+++ bind-9.5.0a5/bin/named/log.c 2007-06-19 11:04:17.000000000 +0200
@@ -44,6 +44,7 @@ static isc_logcategory_t categories[] =
{ "queries", 0 },
{ "unmatched", 0 },
{ "update-security", 0 },
+ { "dbus", 0 },
{ NULL, 0 }
};
@@ -63,6 +64,7 @@ static isc_logmodule_t modules[] = {
{ "notify", 0 },
{ "control", 0 },
{ "lwresd", 0 },
+ { "dbus", 0 },
{ NULL, 0 }
};
--- bind-9.5.0a5/bin/named/include/named/server.h.dbus 2006-12-21 07:02:30.000000000 +0100
+++ bind-9.5.0a5/bin/named/include/named/server.h 2007-06-19 11:16:03.000000000 +0200
@@ -102,6 +102,8 @@ struct ns_server {
isc_httpdmgr_t *httpd;
isc_sockaddr_t httpd_sockaddr;
+
+ ns_dbus_mgr_t * dbus_mgr;
};
#define NS_SERVER_MAGIC ISC_MAGIC('S','V','E','R')
--- bind-9.5.0a5/bin/named/include/named/types.h.dbus 2006-12-22 02:59:43.000000000 +0100
+++ bind-9.5.0a5/bin/named/include/named/types.h 2007-06-19 11:04:17.000000000 +0200
@@ -42,4 +42,6 @@ typedef struct ns_controls ns_controls_
typedef struct ns_dispatch ns_dispatch_t;
typedef ISC_LIST(ns_dispatch_t) ns_dispatchlist_t;
+typedef struct ns_dbus_mgr ns_dbus_mgr_t ;
+
#endif /* NAMED_TYPES_H */
--- bind-9.5.0a5/bin/named/include/named/globals.h.dbus 2007-06-19 11:04:16.000000000 +0200
+++ bind-9.5.0a5/bin/named/include/named/globals.h 2007-06-19 11:04:17.000000000 +0200
@@ -115,6 +115,8 @@ EXTERN const char * ns_g_username INIT
EXTERN int ns_g_listen INIT(3);
EXTERN isc_time_t ns_g_boottime;
+EXTERN int ns_g_dbus INIT(0);
+
#undef EXTERN
#undef INIT
--- bind-9.5.0a5/bin/named/include/named/log.h.dbus 2005-04-29 02:22:30.000000000 +0200
+++ bind-9.5.0a5/bin/named/include/named/log.h 2007-06-19 11:04:17.000000000 +0200
@@ -36,6 +36,7 @@
#define NS_LOGCATEGORY_QUERIES (&ns_g_categories[4])
#define NS_LOGCATEGORY_UNMATCHED (&ns_g_categories[5])
#define NS_LOGCATEGORY_UPDATE_SECURITY (&ns_g_categories[6])
+#define NS_LOGCATEGORY_DBUS (&ns_g_categories[7])
/*
* Backwards compatibility.
@@ -53,6 +54,7 @@
#define NS_LOGMODULE_NOTIFY (&ns_g_modules[8])
#define NS_LOGMODULE_CONTROL (&ns_g_modules[9])
#define NS_LOGMODULE_LWRESD (&ns_g_modules[10])
+#define NS_LOGMODULE_DBUS (&ns_g_modules[11])
isc_result_t
ns_log_init(isc_boolean_t safe);
--- bind-9.5.0a5/bin/named/server.c.dbus 2007-05-15 04:38:34.000000000 +0200
+++ bind-9.5.0a5/bin/named/server.c 2007-06-19 11:04:17.000000000 +0200
@@ -171,6 +171,8 @@ struct zonelistentry {
ISC_LINK(struct zonelistentry) link;
};
+#include <named/dbus_mgr.h>
+
/*
* These zones should not leak onto the Internet.
*/
@@ -2103,12 +2105,12 @@ configure_forward(const cfg_obj_t *confi
if (result != ISC_R_SUCCESS) {
char namebuf[DNS_NAME_FORMATSIZE];
dns_name_format(origin, namebuf, sizeof(namebuf));
- cfg_obj_log(forwarders, ns_g_lctx, ISC_LOG_WARNING,
- "could not set up forwarding for domain '%s': %s",
+ cfg_obj_log(forwarders, ns_g_lctx, ISC_LOG_NOTICE,
+ "setting up forwarding failed for domain '%s': %s",
namebuf, isc_result_totext(result));
goto cleanup;
}
-
+
result = ISC_R_SUCCESS;
cleanup:
@@ -3586,6 +3588,20 @@ run_server(isc_task_t *task, isc_event_t
CHECKFATAL(load_zones(server, ISC_FALSE), "loading zones");
+ server->dbus_mgr = 0L;
+ if( ns_g_dbus )
+ if( dbus_mgr_create
+ ( ns_g_mctx, ns_g_taskmgr, ns_g_socketmgr, ns_g_timermgr,
+ &server->dbus_mgr
+ ) != ISC_R_SUCCESS
+ )
+ {
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
+ NS_LOGMODULE_SERVER, ISC_LOG_WARNING,
+ "dbus_mgr initialization failed. D-BUS service is disabled."
+ );
+ }
+
ns_os_started();
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER,
ISC_LOG_NOTICE, "running");
@@ -3654,6 +3670,9 @@ shutdown_server(isc_task_t *task, isc_ev
dns_db_detach(&server->in_roothints);
+ if( server->dbus_mgr != 0L )
+ dbus_mgr_shutdown(server->dbus_mgr);
+
isc_task_endexclusive(server->task);
isc_task_detach(&server->task);
--- bind-9.5.0a5/bin/named/Makefile.in.dbus 2007-06-19 11:04:17.000000000 +0200
+++ bind-9.5.0a5/bin/named/Makefile.in 2007-06-19 11:04:17.000000000 +0200
@@ -43,6 +43,9 @@ CINCLUDES = -I${srcdir}/include -I${srcd
${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} ${ISC_INCLUDES} \
${DLZDRIVER_INCLUDES} ${DBDRIVER_INCLUDES}
+DBUS_INCLUDES = \
+ -I/usr/lib/dbus-1.0/include -I/usr/include/dbus-1.0
+
CDEFINES = @USE_DLZ@
CWARNINGS =
@@ -60,6 +63,7 @@ ISCCCDEPLIBS = ../../lib/isccc/libisccc.
ISCDEPLIBS = ../../lib/isc/libisc.@A@
LWRESDEPLIBS = ../../lib/lwres/liblwres.@A@
BIND9DEPLIBS = ../../lib/bind9/libbind9.@A@
+DBUSLIBS= -ldbus-1
DEPLIBS = ${LWRESDEPLIBS} ${DNSDEPLIBS} ${BIND9DEPLIBS} \
${ISCCFGDEPLIBS} ${ISCCCDEPLIBS} ${ISCDEPLIBS}
@@ -80,6 +84,7 @@ OBJS = builtin.o client.o config.o cont
zoneconf.o \
lwaddr.o lwresd.o lwdclient.o lwderror.o lwdgabn.o \
lwdgnba.o lwdgrbn.o lwdnoop.o lwsearch.o \
+ dbus_service.o dbus_mgr.o \
${DLZDRIVER_OBJS} ${DBDRIVER_OBJS}
UOBJS = unix/os.o
@@ -94,6 +99,7 @@ SRCS = builtin.c client.c config.c cont
zoneconf.c \
lwaddr.c lwresd.c lwdclient.c lwderror.c lwdgabn.c \
lwdgnba.c lwdgrbn.c lwdnoop.c lwsearch.c \
+ dbus_service.c dbus_mgr.c \
${DLZDRIVER_SRCS} ${DBDRIVER_SRCS}
MANPAGES = named.8 lwresd.8 named.conf.5
@@ -122,9 +128,14 @@ config.o: config.c
-DNS_LOCALSTATEDIR=\"${localstatedir}\" \
-c ${srcdir}/config.c
+dbus_service.o: dbus_service.c
+ ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
+ ${DBUS_INCLUDES} \
+ -c ${srcdir}/dbus_service.c
+
named@EXEEXT@: ${OBJS} ${UOBJS} ${DEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
- ${OBJS} ${UOBJS} ${LIBS}
+ ${OBJS} ${UOBJS} ${LIBS} ${DBUSLIBS}
lwresd@EXEEXT@: named@EXEEXT@
rm -f lwresd@EXEEXT@
--- bind-9.5.0a5/bin/named/named.8.dbus 2007-06-19 11:04:17.000000000 +0200
+++ bind-9.5.0a5/bin/named/named.8 2007-06-19 11:20:15.000000000 +0200
@@ -33,7 +33,7 @@
named \- Internet domain name server
.SH "SYNOPSIS"
.HP 6
-\fBnamed\fR [\fB\-4\fR] [\fB\-6\fR] [\fB\-c\ \fR\fB\fIconfig\-file\fR\fR] [\fB\-d\ \fR\fB\fIdebug\-level\fR\fR] [\fB\-f\fR] [\fB\-g\fR] [\fB\-m\ \fR\fB\fIflag\fR\fR] [\fB\-n\ \fR\fB\fI#cpus\fR\fR] [\fB\-p\ \fR\fB\fIport\fR\fR] [\fB\-s\fR] [\fB\-t\ \fR\fB\fIdirectory\fR\fR] [\fB\-u\ \fR\fB\fIuser\fR\fR] [\fB\-v\fR] [\fB\-x\ \fR\fB\fIcache\-file\fR\fR]
+\fBnamed\fR [\fB\-4\fR] [\fB\-6\fR] [\fB\-c\ \fR\fB\fIconfig\-file\fR\fR] [\fB\-d\ \fR\fB\fIdebug\-level\fR\fR] [\fB\-f\fR] [\fB\-g\fR] [\fB\-m\ \fR\fB\fIflag\fR\fR] [\fB\-n\ \fR\fB\fI#cpus\fR\fR] [\fB\-p\ \fR\fB\fIport\fR\fR] [\fB\-s\fR] [\fB\-t\ \fR\fB\fIdirectory\fR\fR] [\fB\-u\ \fR\fB\fIuser\fR\fR] [\fB\-v\fR] [\fB\-x\ \fR\fB\fIcache\-file\fR\fR] [\fB\-D\fR]
.SH "DESCRIPTION"
.PP
\fBnamed\fR
@@ -181,6 +181,13 @@ into the cache of the default view.
This option must not be used. It is only of interest to BIND 9 developers and may be removed or changed in a future release.
.RE
.RE
+.sp
+.TP
+\fB\-D\fR
+Enable dynamic management of the forwarding table with D-BUS
+messages. This option is required for Red Hat NetworkManager
+support. See doc/README.DBUS .
+.sp
.SH "SIGNALS"
.PP
In routine operation, signals should not be used to control the nameserver;

View file

@ -1,11 +0,0 @@
--- bind-9.2.2/lib/isc/unix/socket.c.bsdcompat 2003-02-18 02:28:41.000000000 -0500
+++ bind-9.2.2/lib/isc/unix/socket.c 2003-07-19 15:40:49.784907968 -0400
@@ -1365,7 +1365,7 @@ isc_socket_create(isc_socketmgr_t *manag
return (ISC_R_UNEXPECTED);
}
-#ifdef SO_BSDCOMPAT
+#if 0
if (setsockopt(sock->fd, SOL_SOCKET, SO_BSDCOMPAT,
(void *)&on, sizeof on) < 0) {
isc__strerror(errno, strbuf, sizeof(strbuf));

View file

@ -45,7 +45,17 @@ function rootdir()
if [ -L "$BIND_CHROOT_PREFIX" ]; then
BIND_CHROOT_PREFIX=`/usr/bin/readlink "$BIND_CHROOT_PREFIX"`;
fi
return 0;
ENABLED=0;
else
ENABLED=1;
fi;
}
function selinux_enabled()
{
if [ -x /usr/sbin/selinuxenabled ]; then
/usr/sbin/selinuxenabled;
return $?;
fi;
return 1;
}
@ -53,12 +63,9 @@ function rootdir()
function check_dirs()
{
if [ -z "$BIND_CHROOT_PREFIX" ]; then
rootdir;
if [ -z "$BIND_CHROOT_PREFIX" ]; then
usage;
exit 1;
fi;
fi
usage;
exit 1;
fi;
BIND_DIR=`echo $BIND_DIR | sed 's#//*#/#g;s#/$##'`;
if [ -L "$BIND_DIR" ]; then
BIND_DIR=`/usr/bin/readlink "$BIND_DIR"`;
@ -67,27 +74,32 @@ function check_dirs()
if [ -L "$BIND_CHROOT_PREFIX" ]; then
BIND_CHROOT_PREFIX=`/usr/bin/readlink "$BIND_CHROOT_PREFIX"`;
fi
/bin/mkdir -p ${BIND_DIR}/{slaves,data};
/bin/chown root:named ${BIND_DIR};
/bin/chown named:named ${BIND_DIR}/{slaves,data};
/bin/chmod 750 ${BIND_DIR}
/bin/chmod 770 ${BIND_DIR}/{slaves,data};
if [ -e /etc/sysconfig/named ]; then
/bin/chown root:named /etc/sysconfig/named;
/bin/chmod 0640 /etc/sysconfig/named;
fi
/bin/mkdir -p ${BIND_DIR}/{slaves,data,dynamic};
/bin/chown --preserve-root root:named ${BIND_DIR};
/bin/chown --preserve-root named:named ${BIND_DIR}/{slaves,data,dynamic};
/bin/chmod --preserve-root 750 ${BIND_DIR}
/bin/chmod --preserve-root 770 ${BIND_DIR}/{slaves,data,dynamic};
mkdir -p ${BIND_CHROOT_PREFIX}/{etc,dev,var/{run/named,named/{slaves,data}}};
/bin/chown root:named ${BIND_CHROOT_PREFIX}/{etc,dev,var/{run,named/}};
/bin/chmod 750 ${BIND_CHROOT_PREFIX}/{,etc,dev,var,var/{run,named/}};
/bin/chown named:named ${BIND_CHROOT_PREFIX}/var/{run/named,named/{data,slaves}};
/bin/chmod 770 ${BIND_CHROOT_PREFIX}/var/{run/named,named/{slaves,data}};
mkdir -p ${BIND_CHROOT_PREFIX}/{etc,dev,var/{run/named,named/{slaves,data,dynamic}}};
/bin/chown --preserve-root root:named ${BIND_CHROOT_PREFIX}/{etc,dev,var/{run,named/}};
/bin/chown --preserve-root root:named ${BIND_CHROOT_PREFIX}/var;
/bin/chmod --preserve-root 750 ${BIND_CHROOT_PREFIX}/{,etc,dev,var,var/{run,named/}};
/bin/chown --preserve-root named:named ${BIND_CHROOT_PREFIX}/var/{run/named,named/{data,slaves,dynamic}};
/bin/chmod --preserve-root 770 ${BIND_CHROOT_PREFIX}/var/{run/named,named/{slaves,data,dynamic}};
[ ! -e "${BIND_CHROOT_PREFIX}/dev/random" ] && /bin/mknod "${BIND_CHROOT_PREFIX}/dev/random" c 1 8
[ ! -e "${BIND_CHROOT_PREFIX}/dev/zero" ] && /bin/mknod "${BIND_CHROOT_PREFIX}/dev/zero" c 1 5
[ ! -e "${BIND_CHROOT_PREFIX}/dev/null" ] && /bin/mknod "${BIND_CHROOT_PREFIX}/dev/null" c 1 3
[ ! -e "${BIND_CHROOT_PREFIX}/etc/localtime" ] && [ -e /etc/localtime ] && /bin/cp -fp /etc/localtime "${BIND_CHROOT_PREFIX}/etc/localtime";
chmod 666 "${BIND_CHROOT_PREFIX}"/dev/{random,null,zero};
if [ -d /selinux ] && [ -e /selinux/enforce ] && [ -x /usr/bin/chcon ]; then
/bin/chown --preserve-root root:named "${BIND_CHROOT_PREFIX}"/dev/{random,null,zero};
/bin/chmod --preserve-root 660 "${BIND_CHROOT_PREFIX}"/dev/{random,null,zero};
if selinux_enabled && [ -x /sbin/restorecon ]; then
for dev in random zero null; do
/usr/bin/chcon --reference=/dev/$dev ${BIND_CHROOT_PREFIX}/dev/$dev;
/sbin/restorecon ${BIND_CHROOT_PREFIX}/dev/$dev;
done
fi;
}
@ -121,7 +133,7 @@ function replace_with_link()
fi
if [ -e "$dst" ]; then
if [ ! -L "$dst" ]; then
if [ ! -s "$dst" ]; then
if [ ! -s "$dst" ] || /usr/bin/cmp "$dst" "$src" > /dev/null 2>&1; then
/bin/rm -f "$dst";
else
if [ "$src" -nt "$dst" ] || [ ! "$dst" -nt "$src" ] ; then
@ -135,13 +147,15 @@ function replace_with_link()
dstlnk=`/usr/bin/readlink "$dst"`
if [ "$dstlnk" != $src ]; then
/bin/rm -f $dst;
if [ "$dstlnk" != "$dst" ] && [ -s $dstlnk ]; then
if [ "$dstlnk" -nt "$src" ] || [ ! "$dstlnk" -nt "$src" ] ; then
/bin/cp -fp "$dstlnk" "$dst".`/bin/date +'%Y-%m-%d_%H-%M-%S.%N'`;
else
/bin/mv "$src" "$src".`/bin/date +'%Y-%m-%d_%H-%M-%S.%N'`;
/bin/cp -fp "$dstlnk" "$src";
fi;
if ! /usr/bin/cmp "$dstlnk" "$src" > /dev/null 2>&1; then
if [ "$dstlnk" != "$dst" ] && [ -s $dstlnk ]; then
if [ "$dstlnk" -nt "$src" ] || [ ! "$dstlnk" -nt "$src" ] ; then
/bin/cp -fp "$dstlnk" "$dst".`/bin/date +'%Y-%m-%d_%H-%M-%S.%N'`;
else
/bin/mv "$src" "$src".`/bin/date +'%Y-%m-%d_%H-%M-%S.%N'`;
/bin/cp -fp "$dstlnk" "$src";
fi;
fi;
fi;
else
return 0;
@ -180,64 +194,126 @@ function replace_with_file()
function enable_bind_chroot()
{
rootdir;
if /bin/egrep -q '^ROOTDIR=' /etc/sysconfig/named; then
/bin/sed -i -e 's#^ROOTDIR=.*$#ROOTDIR='${BIND_CHROOT_PREFIX}'#' /etc/sysconfig/named ;
else
echo 'ROOTDIR='${BIND_CHROOT_PREFIX} >> /etc/sysconfig/named;
fi
fi;
}
function disable_bind_chroot()
{
/bin/sed -i -e '/^ROOTDIR=/d' /etc/sysconfig/named;
/bin/sed -i -e '/^ROOTDIR=/d' /etc/sysconfig/named;
}
function sync_files()
{
rootdir;
shopt -q nullglob;
ng=$?
shopt -s nullglob;
pfx=''
if rootdir ; then # chroot is enabled
/usr/bin/find /{etc/{named.*,rndc.*},${BIND_DIR#/}{/*,/data/*,/slaves/*}} -maxdepth 0 -type f |
changed=`/bin/mktemp /tmp/XXXXXX`;
rm -f $changed
if [ $ENABLED -eq 0 ] ; then # chroot is enabled
/usr/bin/find /{etc/{named.*,rndc.*},${BIND_DIR#/}{/*,/data/*,/slaves/*,/dynamic/*}} /var/log/named.log -maxdepth 0 -type f |
while read f;
do
replace_with_link ${BIND_CHROOT_PREFIX}/$f $f;
replace_with_link ${BIND_CHROOT_PREFIX}$f $f;
[ ! -e $changed ] && touch $changed;
done;
/usr/bin/find /etc/{named.*,rndc.*}.rpmsave ${BIND_DIR}/*.rpmsave -maxdepth 0 -type l 2>/dev/null |
while read f;
do
/bin/rm -f $f >/dev/null 2>&1;
done
pfx=${BIND_CHROOT_PREFIX}
else # chroot is disabled
/usr/bin/find /var/named/chroot/{etc/{named.*,rndc.*},var/named{/*,/data/*,/slaves/*}} -maxdepth 0 |
/usr/bin/find /var/named/chroot/{etc/{named.*,rndc.*},var/{named{/*,/data/*,/slaves/*,/dynamic/*},log/named.log}} -maxdepth 0 |
while read f;
do
if [ ! -d "$f" ]; then
replace_with_file $f ${f#$BIND_CHROOT_PREFIX};
[ ! -e $changed ] && touch $changed;
fi;
done
fi;
if [ ! -e ${pfx}/etc/rndc.key ]; then
echo 'key "rndckey" {
algorithm hmac-md5;
secret "'`/usr/sbin/dns-keygen`'";
};' > /etc/rndc.key;
elif /bin/egrep -q '@KEY@' /etc/rndc.key; then
/bin/sed -i -e 's^@KEY@^'`/usr/sbin/dns-keygen`'^' /etc/rndc.key ;
fi
chown -h root:named /var/named/* >/dev/null 2>&1;
chown -h root:named ${BIND_CHROOT_PREFIX}/var/named/* >/dev/null 2>&1;
chown -h root:named /etc/{named,rndc}.* >/dev/null 2>&1;
chown -h root:named ${BIND_CHROOT_PREFIX}/etc/{named,rndc}.* >/dev/null 2>&1;
chown -h named:named /var/log/named.log >/dev/null 2>&1;
chown -h named:named ${BIND_CHROOT_PREFIX}/var/log/named.log >/dev/null 2>&1;
chmod 750 ${pfx}/var/named >/dev/null 2>&1;
chmod 640 ${pfx}/var/named/* >/dev/null 2>&1;
chmod 750 ${pfx}/var/named/*/. >/dev/null 2>&1;
chmod 660 ${pfx}/var/log/named.log >/dev/null 2>&1;
chown -h named:named /var/named/{data{,/*},slaves{,/*},dynamic{,/*}} >/dev/null 2>&1;
chown -h named:named ${BIND_CHROOT_PREFIX}/var/named/{data{,/*},slaves{,/*},dynamic{,/*}} >/dev/null 2>&1;
chmod 770 ${pfx}/var/named/{data,slaves,dynamic} >/dev/null 2>&1;
chmod 660 ${pfx}/var/named/{data/*,slaves/*,dynamic/*} >/dev/null 2>&1;
chmod 770 ${pfx}/var/named/{data/*/.,slaves/*/.,dynamic/*/.} >/dev/null 2>&1;
if [ -e $changed ]; then
if selinux_enabled && [ -x /sbin/restorecon ]; then
/sbin/restorecon -R ${BIND_CHROOT_PREFIX}/{dev,etc,var} >/dev/null 2>&1;
/sbin/restorecon /etc/named.* >/dev/null 2>&1;
/sbin/restorecon /etc/rndc.key >/dev/null 2>&1;
/sbin/restorecon /etc/rndc.conf >/dev/null 2>&1;
for all in `ls /var/named`; do
if [ "x$all" != "xchroot" ]; then
restorecon -R /var/named/"$all" > /dev/null 2>&1;
fi
done
fi;
/sbin/service named try-restart
rm -f $changed;
fi;
if [ $ng -eq 1 ]; then
shopt -u nullglob;
fi;
chown root:named ${pfx}/var/named/* >/dev/null 2>&1;
chmod 750 ${pfx}/var/named >/dev/null 2>&1;
chmod 640 ${pfx}/var/named/* >/dev/null 2>&1;
chown named:named ${pfx}/var/named/{data{,/*},slaves{,*/}} >/dev/null 2>&1;
chmod 770 ${pfx}/var/named/{data,slaves} >/dev/null 2>&1;
chmod 640 ${pfx}/var/named/{data/*,slaves/*} >/dev/null 2>&1;
}
function clean_root()
{
if [ $ENABLED -eq 0 ] ; then # chroot is disabled, clean it up
if [ -n "${BIND_CHROOT_PREFIX}" -a "x${BIND_CHROOT_PREFIX}" != "x/" ]; then
rm -r ${BIND_CHROOT_PREFIX}/dev >/dev/null 2>&1 || :;
rmdir ${BIND_CHROOT_PREFIX}/proc >/dev/null 2>&1 || :;
rmdir ${BIND_CHROOT_PREFIX}/etc >/dev/null 2>&1 || :;
rmdir ${BIND_CHROOT_PREFIX}/var/run/named >/dev/null 2>&1 || :;
rmdir ${BIND_CHROOT_PREFIX}/var/run/dbus >/dev/null 2>&1 || :;
rmdir ${BIND_CHROOT_PREFIX}/var/run >/dev/null 2>&1 || :;
rmdir ${BIND_CHROOT_PREFIX}/var/named/slaves >/dev/null 2>&1 || :;
rmdir ${BIND_CHROOT_PREFIX}/var/named/data >/dev/null 2>&1 || :;
rmdir ${BIND_CHROOT_PREFIX}/var/named/dynamic >/dev/null 2>&1 || :;
rmdir ${BIND_CHROOT_PREFIX}/var/named >/dev/null 2>&1 || :;
rmdir ${BIND_CHROOT_PREFIX}/var/tmp >/dev/null 2>&1 || :;
rmdir ${BIND_CHROOT_PREFIX}/var >/dev/null 2>&1 || :;
fi;
fi;
}
case $1 in
-e|--enable)
enable_bind_chroot;
sync_files;
/sbin/service named condrestart
exit $?;
;;
-d|--disable)
disable_bind_chroot;
sync_files;
/sbin/service named condrestart
/bin/umount ${BIND_CHROOT_PREFIX}/proc >/dev/null 2>&1 || :;
/bin/umount ${BIND_CHROOT_PREFIX}/var/run/dbus >/dev/null 2>&1 || :;
clean_root;
exit $?;
;;
-s|--sync)
@ -249,4 +325,4 @@ case $1 in
*)
usage;
exit 1;
esac
esac

1487
bind.spec

File diff suppressed because it is too large Load diff

50
bind95-rh454783.patch Normal file
View file

@ -0,0 +1,50 @@
diff -up bind-9.5.0-P1/bin/named/xfrout.c.rh454783 bind-9.5.0-P1/bin/named-sdb/xfrout.c
--- bind-9.5.0-P1/bin/named/xfrout.c.rh454783 2008-08-05 12:50:44.000000000 +0200
+++ bind-9.5.0-P1/bin/named/xfrout.c 2008-08-05 12:57:54.000000000 +0200
@@ -829,7 +829,9 @@ typedef struct {
dns_name_t *qname; /* Question name of request */
dns_rdatatype_t qtype; /* dns_rdatatype_{a,i}xfr */
dns_rdataclass_t qclass;
+#ifndef DLZ
dns_zone_t *zone; /* (necessary for stats) */
+#endif
dns_db_t *db;
dns_dbversion_t *ver;
isc_quota_t *quota;
@@ -1330,10 +1332,14 @@ xfrout_ctx_create(isc_mem_t *mctx, ns_cl
xfr->qname = qname;
xfr->qtype = qtype;
xfr->qclass = qclass;
+#ifndef DLZ
xfr->zone = NULL;
+#endif
xfr->db = NULL;
xfr->ver = NULL;
+#ifndef DLZ
dns_zone_attach(zone, &xfr->zone);
+#endif
dns_db_attach(db, &xfr->db);
dns_db_attachversion(db, ver, &xfr->ver);
xfr->end_of_stream = ISC_FALSE;
@@ -1709,8 +1715,10 @@ xfrout_ctx_destroy(xfrout_ctx_t **xfrp)
isc_quota_detach(&xfr->quota);
if (xfr->ver != NULL)
dns_db_closeversion(xfr->db, &xfr->ver, ISC_FALSE);
+#ifndef DLZ
if (xfr->zone != NULL)
dns_zone_detach(&xfr->zone);
+#endif
if (xfr->db != NULL)
dns_db_detach(&xfr->db);
@@ -1744,7 +1752,10 @@ xfrout_senddone(isc_task_t *task, isc_ev
sendstream(xfr);
} else {
/* End of zone transfer stream. */
+#ifndef DLZ
+ /* XXX DLZ zones doesn't support stats */
inc_stats(xfr->zone, dns_nsstatscounter_xfrdone);
+#endif
xfrout_log(xfr, ISC_LOG_INFO, "%s ended", xfr->mnemonic);
ns_client_next(xfr->client, ISC_R_SUCCESS);
xfrout_ctx_destroy(&xfr);

25
bind95-rh457175.patch Normal file
View file

@ -0,0 +1,25 @@
diff -up bind-9.5.0-P1/lib/dns/iptable.c.rh457175 bind-9.5.0-P1/lib/dns/iptable.c
--- bind-9.5.0-P1/lib/dns/iptable.c.rh457175 2008-01-21 22:02:24.000000000 +0100
+++ bind-9.5.0-P1/lib/dns/iptable.c 2008-07-31 16:10:46.000000000 +0200
@@ -117,16 +117,17 @@ dns_iptable_merge(dns_iptable_t *tab, dn
if (node->data[0] &&
*(isc_boolean_t *) node->data[0] == ISC_TRUE)
new_node->data[0] = &dns_iptable_neg;
- else
- new_node->data[0] = node->data[0];
if (node->data[1] &&
*(isc_boolean_t *) node->data[1] == ISC_TRUE)
new_node->data[1] = &dns_iptable_neg;
- else
- new_node->data[1] = node->data[0];
}
+ if (new_node->data[0] == NULL)
+ new_node->data[0] = node->data[0];
+ if (new_node->data[1] == NULL)
+ new_node->data[1] = node->data[1];
+
if (node->node_num[0] > max_node)
max_node = node->node_num[0];
if (node->node_num[1] > max_node)

409
ldap2zone.c Normal file
View file

@ -0,0 +1,409 @@
/*
* Copyright (C) 2004, 2005 Stig Venaas <venaas@uninett.no>
* $Id: ldap2zone.c,v 0.1 2005/04/23 21:30:12 venaas Exp $
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*/
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <ldap.h>
struct string {
void *data;
size_t len;
};
struct assstack_entry {
struct string key;
struct string val;
struct assstack_entry *next;
};
struct assstack_entry *assstack_find(struct assstack_entry *stack, struct string *key);
void assstack_push(struct assstack_entry **stack, struct assstack_entry *item);
void assstack_insertbottom(struct assstack_entry **stack, struct assstack_entry *item);
void printsoa(struct string *soa);
void printrrs(char *defaultttl, struct assstack_entry *item);
void print_zone(char *defaultttl, struct assstack_entry *stack);
void usage(char *name);
void err(char *name, const char *msg);
int putrr(struct assstack_entry **stack, struct berval *name, char *type, char *ttl, struct berval *val);
struct assstack_entry *assstack_find(struct assstack_entry *stack, struct string *key) {
for (; stack; stack = stack->next)
if (stack->key.len == key->len && !memcmp(stack->key.data, key->data, key->len))
return stack;
return NULL;
}
void assstack_push(struct assstack_entry **stack, struct assstack_entry *item) {
item->next = *stack;
*stack = item;
}
void assstack_insertbottom(struct assstack_entry **stack, struct assstack_entry *item) {
struct assstack_entry *p;
item->next = NULL;
if (!*stack) {
*stack = item;
return;
}
/* find end, should keep track of end somewhere */
/* really a queue, not a stack */
p = *stack;
while (p->next)
p = p->next;
p->next = item;
}
void printsoa(struct string *soa) {
char *s;
size_t i;
s = (char *)soa->data;
i = 0;
while (i < soa->len) {
putchar(s[i]);
if (s[i++] == ' ')
break;
}
while (i < soa->len) {
putchar(s[i]);
if (s[i++] == ' ')
break;
}
printf("(\n\t\t\t\t");
while (i < soa->len) {
putchar(s[i]);
if (s[i++] == ' ')
break;
}
printf("; Serialnumber\n\t\t\t\t");
while (i < soa->len) {
if (s[i] == ' ')
break;
putchar(s[i++]);
}
i++;
printf("\t; Refresh\n\t\t\t\t");
while (i < soa->len) {
if (s[i] == ' ')
break;
putchar(s[i++]);
}
i++;
printf("\t; Retry\n\t\t\t\t");
while (i < soa->len) {
if (s[i] == ' ')
break;
putchar(s[i++]);
}
i++;
printf("\t; Expire\n\t\t\t\t");
while (i < soa->len) {
putchar(s[i++]);
}
printf(" )\t; Minimum TTL\n");
}
void printrrs(char *defaultttl, struct assstack_entry *item) {
struct assstack_entry *stack;
char *s;
int first;
size_t i;
char *ttl, *type;
int top;
s = (char *)item->key.data;
if (item->key.len == 1 && *s == '@') {
top = 1;
printf("@\t");
} else {
top = 0;
for (i = 0; i < item->key.len; i++)
putchar(s[i]);
if (item->key.len < 8)
putchar('\t');
putchar('\t');
}
first = 1;
for (stack = (struct assstack_entry *) item->val.data; stack; stack = stack->next) {
ttl = (char *)stack->key.data;
s = strchr(ttl, ' ');
*s++ = '\0';
type = s;
if (first)
first = 0;
else
printf("\t\t");
if (strcmp(defaultttl, ttl))
printf("%s", ttl);
putchar('\t');
if (top) {
top = 0;
printf("IN\t%s\t", type);
/* Should always be SOA here */
if (!strcmp(type, "SOA")) {
printsoa(&stack->val);
continue;
}
} else
printf("%s\t", type);
s = (char *)stack->val.data;
for (i = 0; i < stack->val.len; i++)
putchar(s[i]);
putchar('\n');
}
}
void print_zone(char *defaultttl, struct assstack_entry *stack) {
printf("$TTL %s\n", defaultttl);
for (; stack; stack = stack->next)
printrrs(defaultttl, stack);
};
void usage(char *name) {
fprintf(stderr, "Usage:%s zone-name LDAP-URL default-ttl [serial]\n", name);
exit(1);
};
void err(char *name, const char *msg) {
fprintf(stderr, "%s: %s\n", name, msg);
exit(1);
};
int putrr(struct assstack_entry **stack, struct berval *name, char *type, char *ttl, struct berval *val) {
struct string key;
struct assstack_entry *rr, *rrdata;
/* Do nothing if name or value have 0 length */
if (!name->bv_len || !val->bv_len)
return 0;
/* see if already have an entry for this name */
key.len = name->bv_len;
key.data = name->bv_val;
rr = assstack_find(*stack, &key);
if (!rr) {
/* Not found, create and push new entry */
rr = (struct assstack_entry *) malloc(sizeof(struct assstack_entry));
if (!rr)
return -1;
rr->key.len = name->bv_len;
rr->key.data = (void *) malloc(rr->key.len);
if (!rr->key.data) {
free(rr);
return -1;
}
memcpy(rr->key.data, name->bv_val, name->bv_len);
rr->val.len = sizeof(void *);
rr->val.data = NULL;
if (name->bv_len == 1 && *(char *)name->bv_val == '@')
assstack_push(stack, rr);
else
assstack_insertbottom(stack, rr);
}
rrdata = (struct assstack_entry *) malloc(sizeof(struct assstack_entry));
if (!rrdata) {
free(rr->key.data);
free(rr);
return -1;
}
rrdata->key.len = strlen(type) + strlen(ttl) + 1;
rrdata->key.data = (void *) malloc(rrdata->key.len);
if (!rrdata->key.data) {
free(rrdata);
free(rr->key.data);
free(rr);
return -1;
}
sprintf((char *)rrdata->key.data, "%s %s", ttl, type);
rrdata->val.len = val->bv_len;
rrdata->val.data = (void *) malloc(val->bv_len);
if (!rrdata->val.data) {
free(rrdata->key.data);
free(rrdata);
free(rr->key.data);
free(rr);
return -1;
}
memcpy(rrdata->val.data, val->bv_val, val->bv_len);
if (!strcmp(type, "SOA"))
assstack_push((struct assstack_entry **) &(rr->val.data), rrdata);
else
assstack_insertbottom((struct assstack_entry **) &(rr->val.data), rrdata);
return 0;
}
int main(int argc, char **argv) {
char *s, *hostporturl, *base = NULL;
char *ttl, *defaultttl;
LDAP *ld;
char *fltr = NULL;
LDAPMessage *res, *e;
char *a, **ttlvals, **soavals, *serial;
struct berval **vals, **names;
char type[64];
BerElement *ptr;
int i, j, rc, msgid;
struct assstack_entry *zone = NULL;
if (argc < 4 || argc > 5)
usage(argv[0]);
hostporturl = argv[2];
if (hostporturl != strstr( hostporturl, "ldap"))
err(argv[0], "Not an LDAP URL");
s = strchr(hostporturl, ':');
if (!s || strlen(s) < 3 || s[1] != '/' || s[2] != '/')
err(argv[0], "Not an LDAP URL");
s = strchr(s+3, '/');
if (s) {
*s++ = '\0';
base = s;
s = strchr(base, '?');
if (s)
err(argv[0], "LDAP URL can only contain host, port and base");
}
defaultttl = argv[3];
rc = ldap_initialize(&ld, hostporturl);
if (rc != LDAP_SUCCESS)
err(argv[0], "ldap_initialize() failed");
if (argc == 5) {
/* serial number specified, check if different from one in SOA */
fltr = (char *)malloc(strlen(argv[1]) + strlen("(&(relativeDomainName=@)(zoneName=))") + 1);
sprintf(fltr, "(&(relativeDomainName=@)(zoneName=%s))", argv[1]);
msgid = ldap_search(ld, base, LDAP_SCOPE_SUBTREE, fltr, NULL, 0);
if (msgid == -1)
err(argv[0], "ldap_search() failed");
while ((rc = ldap_result(ld, msgid, 0, NULL, &res)) != LDAP_RES_SEARCH_RESULT ) {
/* not supporting continuation references at present */
if (rc != LDAP_RES_SEARCH_ENTRY)
err(argv[0], "ldap_result() returned cont.ref? Exiting");
/* only one entry per result message */
e = ldap_first_entry(ld, res);
if (e == NULL) {
ldap_msgfree(res);
err(argv[0], "ldap_first_entry() failed");
}
soavals = ldap_get_values(ld, e, "SOARecord");
if (soavals)
break;
}
ldap_msgfree(res);
if (!soavals) {
err(argv[0], "No SOA Record found");
}
/* We have a SOA, compare serial numbers */
/* Only checkinf first value, should be only one */
s = strchr(soavals[0], ' ');
s++;
s = strchr(s, ' ');
s++;
serial = s;
s = strchr(s, ' ');
*s = '\0';
if (!strcmp(serial, argv[4])) {
ldap_value_free(soavals);
err(argv[0], "serial numbers match");
}
ldap_value_free(soavals);
}
if (!fltr)
fltr = (char *)malloc(strlen(argv[1]) + strlen("(zoneName=)") + 1);
if (!fltr)
err(argv[0], "Malloc failed");
sprintf(fltr, "(zoneName=%s)", argv[1]);
msgid = ldap_search(ld, base, LDAP_SCOPE_SUBTREE, fltr, NULL, 0);
if (msgid == -1)
err(argv[0], "ldap_search() failed");
while ((rc = ldap_result(ld, msgid, 0, NULL, &res)) != LDAP_RES_SEARCH_RESULT ) {
/* not supporting continuation references at present */
if (rc != LDAP_RES_SEARCH_ENTRY)
err(argv[0], "ldap_result() returned cont.ref? Exiting");
/* only one entry per result message */
e = ldap_first_entry(ld, res);
if (e == NULL) {
ldap_msgfree(res);
err(argv[0], "ldap_first_entry() failed");
}
names = ldap_get_values_len(ld, e, "relativeDomainName");
if (!names)
continue;
ttlvals = ldap_get_values(ld, e, "dNSTTL");
ttl = ttlvals ? ttlvals[0] : defaultttl;
for (a = ldap_first_attribute(ld, e, &ptr); a != NULL; a = ldap_next_attribute(ld, e, ptr)) {
char *s;
for (s = a; *s; s++)
*s = toupper(*s);
s = strstr(a, "RECORD");
if ((s == NULL) || (s == a) || (s - a >= (signed int)sizeof(type))) {
ldap_memfree(a);
continue;
}
strncpy(type, a, s - a);
type[s - a] = '\0';
vals = ldap_get_values_len(ld, e, a);
if (vals) {
for (i = 0; vals[i]; i++)
for (j = 0; names[j]; j++)
if (putrr(&zone, names[j], type, ttl, vals[i]))
err(argv[0], "malloc failed");
ldap_value_free_len(vals);
}
ldap_memfree(a);
}
if (ptr)
ber_free(ptr, 0);
if (ttlvals)
ldap_value_free(ttlvals);
ldap_value_free_len(names);
/* free this result */
ldap_msgfree(res);
}
/* free final result */
ldap_msgfree(res);
print_zone(defaultttl, zone);
return 0;
}

View file

@ -1,26 +0,0 @@
--- bind-9.3.1rc1/lib/bind/irs/irs_data.c.fix_h_errno 2004-11-29 20:15:43.000000000 -0500
+++ bind-9.3.1rc1/lib/bind/irs/irs_data.c 2005-03-09 21:05:52.000000000 -0500
@@ -222,12 +222,7 @@
void
__h_errno_set(struct __res_state *res, int err) {
-
-#if (__GLIBC__ > 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)
- res->res_h_errno = err;
-#else
h_errno = res->res_h_errno = err;
-#endif
}
#endif /*__BIND_NOSTATIC*/
--- bind-9.3.1rc1/lib/bind/resolv/res_query.c.fix_h_errno 2004-03-16 07:34:19.000000000 -0500
+++ bind-9.3.1rc1/lib/bind/resolv/res_query.c 2005-03-09 21:53:34.000000000 -0500
@@ -192,6 +192,8 @@
}
return (-1);
}
+ if( n > 0 )
+ RES_SET_H_ERRNO(statp,0);
return (n);
}

View file

@ -1,6 +1,6 @@
# pkg-config file for libbind
Name: libbind
Name: bind-devel
Description: BIND 8 compatible DNS Resolver Library
Version: 9.3.2
Libs: -L/usr/lib -lbind
Cflags: -I/usr/include/bind
Libs: -lbind
Cflags: -I/usr/include/bind

View file

@ -1,10 +0,0 @@
$TTL 86400
@ IN SOA localhost root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS localhost
localhost IN A 127.0.0.1

View file

@ -1,12 +0,0 @@
$TTL 86400
@ IN SOA @ root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS @
IN A 127.0.0.1
IN AAAA ::1

View file

@ -1,8 +0,0 @@
$TTL 86400
@ IN SOA localhost. root.localhost. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS localhost.

View file

@ -1,34 +0,0 @@
//
// named.caching-nameserver.conf
//
// Provided by Red Hat bind-config package to configure the
// ISC BIND named(8) DNS server as a caching only nameserver
// (as a localhost DNS resolver only).
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// bind-config package upgrade.
//
options {
listen-on port 53 { 127.0.0.1; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
query-source port 53;
query-source-v6 port 53;
allow-query { localhost; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view localhost_resolver {
match-clients { localhost; };
match-destinations { localhost; };
recursion yes;
include "/etc/named.rfc1912.zones";
};

127
named.conf.sample Normal file
View file

@ -0,0 +1,127 @@
//
// Sample named.conf BIND DNS server 'named' configuration file
// for the Red Hat BIND distribution.
//
// See the BIND Administrator's Reference Manual (ARM) for details, in:
// file:///usr/share/doc/bind-*/arm/Bv9ARM.html
// Also see the BIND Configuration GUI : /usr/bin/system-config-bind and
// its manual.
//
options
{
/* make named use port 53 for the source of all queries, to allow
* firewalls to block all ports except 53:
*/
query-source port 53;
query-source-v6 port 53;
// Put files that named is allowed to write in the data/ directory:
directory "/var/named"; // the default
dump-file "data/cache_dump.db";
statistics-file "data/named_stats.txt";
memstatistics-file "data/named_mem_stats.txt";
};
logging
{
/* If you want to enable debugging, eg. using the 'rndc trace' command,
* named will try to write the 'named.run' file in the $directory (/var/named).
* By default, SELinux policy does not allow named to modify the /var/named directory,
* so put the default debug log file in data/ :
*/
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
//
// All BIND 9 zones are in a "view", which allow different zones to be served
// to different types of client addresses, and for options to be set for groups
// of zones.
//
// By default, if named.conf contains no "view" clauses, all zones are in the
// "default" view, which matches all clients.
//
// If named.conf contains any "view" clause, then all zones MUST be in a view;
// so it is recommended to start off using views to avoid having to restructure
// your configuration files in the future.
//
view "localhost_resolver"
{
/* This view sets up named to be a localhost resolver ( caching only nameserver ).
* If all you want is a caching-only nameserver, then you need only define this view:
*/
match-clients { localhost; };
match-destinations { localhost; };
recursion yes;
# all views must contain the root hints zone:
include "/etc/named.root.hints";
/* these are zones that contain definitions for all the localhost
* names and addresses, as recommended in RFC1912 - these names should
* ONLY be served to localhost clients:
*/
include "/etc/named.rfc1912.zones";
};
view "internal"
{
/* This view will contain zones you want to serve only to "internal" clients
that connect via your directly attached LAN interfaces - "localnets" .
*/
match-clients { localnets; };
match-destinations { localnets; };
recursion yes;
// all views must contain the root hints zone:
include "/etc/named.root.hints";
// include "named.rfc1912.zones";
// you should not serve your rfc1912 names to non-localhost clients.
// These are your "authoritative" internal zones, and would probably
// also be included in the "localhost_resolver" view above :
zone "my.internal.zone" {
type master;
file "my.internal.zone.db";
};
zone "my.slave.internal.zone" {
type slave;
file "slaves/my.slave.internal.zone.db";
masters { /* put master nameserver IPs here */ 127.0.0.1; } ;
// put slave zones in the slaves/ directory so named can update them
};
zone "my.ddns.internal.zone" {
type master;
allow-update { key ddns_key; };
file "slaves/my.ddns.internal.zone.db";
// put dynamically updateable zones in the slaves/ directory so named can update them
};
};
key ddns_key
{
algorithm hmac-md5;
secret "use /usr/sbin/dns-keygen to generate TSIG keys";
};
view "external"
{
/* This view will contain zones you want to serve only to "external" clients
* that have addresses that are not on your directly attached LAN interface subnets:
*/
match-clients { !localnets; !localhost; };
match-destinations { !localnets; !localhost; };
recursion no;
// you'd probably want to deny recursion to external clients, so you don't
// end up providing free DNS service to all takers
// all views must contain the root hints zone:
include "/etc/named.root.hints";
// These are your "authoritative" external zones, and would probably
// contain entries for just your web and mail servers:
zone "my.external.zone" {
type master;
file "my.external.zone.db";
};
};

8
named.empty Normal file
View file

@ -0,0 +1,8 @@
$TTL 1D
@ IN SOA localhost. root.localhost. (
0 ; serial
3H ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS localhost.

View file

@ -8,17 +8,32 @@
# that is used to resolve host names to IP addresses.
# probe: true
### BEGIN INIT INFO
# Provides: $named
# Required-Start: $local_fs $network $syslog
# Required-Stop: $local_fs $network $syslog
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: start|stop|status|restart|try-restart|reload|force-reload DNS server
# Description: control ISC BIND implementation of DNS server
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
[ -r /etc/sysconfig/network ] && . /etc/sysconfig/network
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 1
[ -r /etc/sysconfig/named ] && . /etc/sysconfig/named
RETVAL=0
export KRB5_KTNAME=${KEYTAB_FILE:-/etc/named.keytab}
named='named'
if [ -x /usr/sbin/named-sdb ]; then
named='named-sdb'
fi
# Don't kill named during clean-up
NAMED_SHUTDOWN_TIMEOUT=${NAMED_SHUTDOWN_TIMEOUT:-25}
if [ -n "$ROOTDIR" ]; then
ROOTDIR=`echo $ROOTDIR | sed 's#//*#/#g;s#/$##'`;
rdl=`/usr/bin/readlink $ROOTDIR`;
@ -27,181 +42,158 @@ if [ -n "$ROOTDIR" ]; then
fi;
fi
RETVAL=0
named='named'
if [[ "$ENABLE_SDB" = [yY1]* ]] && [ -x /usr/sbin/named_sdb ]; then
named='named_sdb';
fi;
prog=$named
# Check if all what named needs running
start()
{
# Source networking configuration.
[ -r /etc/sysconfig/network ] && . /etc/sysconfig/network
[ -x /usr/sbin/$named ] || exit 1
# Check that networking is up
[ "${NETWORKING}" = "no" ] && exit 1
nmdcOption()
{ let i=0;
for a in $*;
do ((++i));
if [ $a = -c ]; then
((++i));
eval 'echo $'$i;
elif [[ $a = -c* ]]; then
echo ${a#-c};
fi;
done;
[ -x /usr/sbin/"$named" ] || exit 5
# Handle -c option
previous_option='unspecified';
for a in $OPTIONS; do
if [ $previous_option = '-c' ]; then
named_conf=$a;
fi;
previous_option=$a;
done;
named_conf=${named_conf:-/etc/named.conf};
if [ ! -r $named_conf ]; then
echo 'Cannot find configuration file. You could create it by system-config-bind'
exit 6;
fi;
# all pre-start is done, lets start named
echo -n $"Starting named: "
if [ -n "`/sbin/pidof -o %PPID "$named"`" ]; then
echo -n $"named: already running"
failure
echo
exit 1;
fi;
ckcf_options='-z'; # enable named-checkzone for each zone (9.3.1+) !
if [ -n "${ROOTDIR}" -a "x${ROOTDIR}" != "x/" ]; then
OPTIONS="${OPTIONS} -t ${ROOTDIR}"
ckcf_options="$ckcf_options -t ${ROOTDIR}";
[ -s /etc/localtime ] && cp -fp /etc/localtime ${ROOTDIR}/etc/localtime;
[ -d ${ROOTDIR}/proc ] || mkdir -p ${ROOTDIR}/proc;
if ! egrep -q '^/proc[[:space:]]+'${ROOTDIR}'/proc' /proc/mounts; then
mount --bind -n /proc ${ROOTDIR}/proc >/dev/null 2>&1;
fi
if [ ! -z $dbusEnabled ]; then
if ! egrep -q '^/[^[:space:]]+[[:space:]]+'${ROOTDIR}'/var/run/dbus' /proc/mounts; then
mkdir -p ${ROOTDIR}/var/run/dbus
[ -d /var/run/dbus ] || mkdir -p /var/run/dbus;
mount --bind -n /var/run/dbus ${ROOTDIR}/var/run/dbus > /dev/null 2>&1;
fi;
fi;
fi
RETVAL=0
# check if configuration is correct
if [ -x /usr/sbin/named-checkconf ] && [ -x /usr/sbin/named-checkzone ] && /usr/sbin/named-checkconf $ckcf_options ${named_conf} >/dev/null 2>&1; then
daemon /usr/sbin/"$named" -u named ${OPTIONS};
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
rm -f /var/run/{named,named-sdb}.pid;
ln -s $ROOTDIR/var/run/named/"$named".pid /var/run/"$named".pid;
fi;
if [ -n "`/sbin/pidof -o %PPID "$named"`" ]; then
# Verify that named actually started (JM 2006-10-04)
if [ ! -e $ROOTDIR/var/run/named/"$named".pid ]; then
# If there is not a file containing the PID of the now running named daemon then create it (JM 2006-10-04)
echo `/sbin/pidof -o %PPID "$named"` > $ROOTDIR/var/run/named/"$named".pid;
fi;
fi;
else
named_err="`/usr/sbin/named-checkconf $ckcf_options $named_conf 2>&1`";
echo
echo "Error in named configuration:";
echo "$named_err";
failure
echo
[ -x /usr/bin/logger ] && echo "$named_err" | /usr/bin/logger -pdaemon.error -tnamed;
exit 2;
fi;
echo
if [ $RETVAL -eq 0 ]; then
touch /var/lock/subsys/named;
else
exit 7;
fi
return 0;
}
named_c_option=`nmdcOption $OPTIONS`;
named_conf=${named_c_option:-/etc/named.conf};
if [ ! -r ${ROOTDIR}${named_conf} ] ; then
if [ -z "$named_c_option" ] && [ -r ${ROOTDIR}/etc/named.caching-nameserver.conf ]; then
named_conf='/etc/named.caching-nameserver.conf';
OPTIONS="$OPTIONS -c ${named_conf}";
else
echo Locating $ROOTDIR/${named_conf} failed:
failure
echo;
fi;
fi;
start() {
# Start daemons.
echo -n $"Starting $named: "
if [ -n "`/sbin/pidof -o %PPID $named`" ]; then
echo -n $"$named: already running"
failure
echo
return 1
fi
ckcf_options='-z'; # enable named-checkzone for each zone (9.3.1+) !
if [ -n "${ROOTDIR}" -a "x${ROOTDIR}" != "x/" ]; then
OPTIONS="${OPTIONS} -t ${ROOTDIR}"
ckcf_options="$ckcf_options -t ${ROOTDIR}";
if [ -s /etc/localtime ]; then
cp -fp /etc/localtime ${ROOTDIR}/etc/localtime
fi;
if [ ! -d ${ROOTDIR}/proc ]; then
mkdir -p ${ROOTDIR}/proc
fi
if ! egrep -q '^/proc[[:space:]]+'${ROOTDIR}'/proc' /proc/mounts; then
mount --bind /proc ${ROOTDIR}/proc >/dev/null 2>&1
fi
dbus=0;
for a in $OPTIONS; do
if [ $a = "-D" ]; then
dbus=1;
fi;
done
if [ $dbus -eq 1 ]; then
if ! egrep -q '^/[^[:space:]]+[[:space:]]+'${ROOTDIR}'/var/run/dbus' /proc/mounts; then
mkdir -p ${ROOTDIR}/var/run/dbus
if [ ! -d /var/run/dbus ] ; then
mkdir -p /var/run/dbus ;
fi;
mount --bind /var/run/dbus ${ROOTDIR}/var/run/dbus > /dev/null 2>&1;
fi;
fi;
fi
no_write_master_zones=0
if [ -e /etc/selinux/config ]; then
. /etc/selinux/config
if [[ ( "$SELINUX" != 'disabled') && ("$SELINUXTYPE" != "") && (-d /etc/selinux/${SELINUXTYPE}) && (-e /etc/selinux/${SELINUXTYPE}/booleans || (-e /etc/selinux/${SELINUXTYPE}/booleans.local)) ]]; then
if [ -e /etc/selinux/${SELINUXTYPE}/booleans.local ]; then
. /etc/selinux/${SELINUXTYPE}/booleans.local;
else
. /etc/selinux/${SELINUXTYPE}/booleans;
fi;
if echo "$named_write_master_zones" | /bin/egrep -q '^[0-9]+$'; then
if [ "$named_write_master_zones" -eq 1 ] ; then
/bin/chown -f --from=root:named named:named $ROOTDIR/var/named
elif [ "$named_write_master_zones" -eq 0 ] ; then
/bin/chown -f --from=named:named root:named $ROOTDIR/var/named
fi;
fi;
else
no_write_master_zones=1
fi;
else
no_write_master_zones=1
fi;
if [ "$no_write_master_zones" -eq 1 ]; then
if [[ "$ENABLE_ZONE_WRITE" = [yY1]* ]]; then
/bin/chown -f --from=root:named named:named $ROOTDIR/var/named
elif [[ "$ENABLE_ZONE_WRITE" = [nN0]* ]]; then
/bin/chown -f --from=named:named root:named $ROOTDIR/var/named
fi;
fi
conf_ok=0;
if [ -x /usr/sbin/named-checkconf ] && [ -x /usr/sbin/named-checkzone ] && /usr/sbin/named-checkconf $ckcf_options ${named_conf} >/dev/null 2>&1; then
conf_ok=1;
else
RETVAL=$?;
fi
if [ $conf_ok -eq 1 ]; then
daemon /usr/sbin/$named -u named ${OPTIONS};
RETVAL=$?;
if [ $RETVAL -eq 0 ]; then
rm -f /var/run/named.pid
rm -f /var/run/named_sdb.pid 2>/dev/null
ln -s $ROOTDIR/var/run/named/named.pid /var/run/named.pid;
if [ "$named" = "named_sdb" ]; then
ln -s $ROOTDIR/var/run/named/named.pid /var/run/named_sdb.pid;
fi;
fi;
else
named_err="`/usr/sbin/named-checkconf $ckcf_options $named_conf 2>&1`";
echo
echo $"Error in named configuration"':';
echo "$named_err";
failure
echo
if [ -x /usr/bin/logger ]; then
echo "$named_err" | /usr/bin/logger -pdaemon.error -tnamed
fi;
return $RETVAL;
fi;
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/named
echo
return $RETVAL
}
stop() {
# Stop daemons.
echo -n $"Stopping $named: "
/usr/sbin/rndc stop >/dev/null 2>&1
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
rm -f /var/lock/subsys/named
rm -f /var/run/named.pid
rm -f /var/run/named_sdb.pid 2>/dev/null
elif /sbin/pidof -o %PPID $named >/dev/null; then
killproc $named -TERM >/dev/null 2>&1
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
rm -f /var/lock/subsys/named
rm -f /var/run/named.pid
rm -f /var/run/named_sdb.pid 2>/dev/null
fi;
fi;
if [ $RETVAL -eq 0 ]; then
success
else
failure
fi;
echo
return $RETVAL
# Stop daemons.
echo -n $"Stopping named: "
[ -x /usr/sbin/rndc ] && /usr/sbin/rndc stop >/dev/null 2>&1;
RETVAL=$?
# was rndc successful?
[ "$RETVAL" -eq 0 ] || killproc "$named" -TERM >/dev/null 2>&1
timeout=0
RETVAL=0
while /sbin/pidof -o %PPID "$named" >/dev/null; do
if [ $timeout -ge $NAMED_SHUTDOWN_TIMEOUT ]; then
RETVAL=1
break
else
sleep 2 && echo -n "."
timeout=$((timeout+2))
fi;
done
# remove pid files
if [ $RETVAL -eq 0 ]; then
rm -f /var/lock/subsys/named
rm -f /var/run/{named,named-sdb}.pid
fi;
# unmount mounted filesystems/directories
if [ -n "${ROOTDIR}" -a "x${ROOTDIR}" != "x/" ]; then
if egrep -q '^/proc[[:space:]]+'${ROOTDIR}'/proc' /proc/mounts; then
umount ${ROOTDIR}/proc >/dev/null 2>&1
fi
if [ ! -z $dbusEnabled ]; then
if egrep -q '^/[^[:space:]]+[[:space:]]+'${ROOTDIR}'/var/run/dbus' /proc/mounts; then
umount ${ROOTDIR}/var/run/dbus > /dev/null 2>&1
fi;
fi;
fi;
if [ $RETVAL -eq 0 ]; then
success
else
failure
RETVAL=1
fi;
echo
return $RETVAL
}
rhstatus() {
/usr/sbin/rndc status
return $?
[ -x /usr/sbin/rndc ] && /usr/sbin/rndc status;
status /usr/sbin/"$named";
return $?
}
restart() {
stop
# wait a couple of seconds for the named to finish closing down
sleep 2
start
}
reload() {
echo -n $"Reloading $named: "
p=`/sbin/pidof -o %PPID $named`
echo -n $"Reloading "$named": "
p=`/sbin/pidof -o %PPID "$named"`
RETVAL=$?
if [ "$RETVAL" -eq 0 ]; then
/usr/sbin/rndc reload >/dev/null 2>&1 || /bin/kill -HUP $p;
@ -209,25 +201,7 @@ reload() {
fi
[ "$RETVAL" -eq 0 ] && success $"$named reload" || failure $"$named reload"
echo
return $?
}
probe() {
# named knows how to reload intelligently; we don't want linuxconf
# to offer to restart every time
/usr/sbin/rndc reload >/dev/null 2>&1 || echo start
return $?
}
checkconfig() {
ckcf_options='-z'; # enable named-checkzone for each zone (9.3.1+) !
if [ -n "${ROOTDIR}" -a "x${ROOTDIR}" != "x/" ]; then
OPTIONS="${OPTIONS} -t ${ROOTDIR}"
ckcf_options="$ckcf_options -t ${ROOTDIR}";
fi;
if [ -x /usr/sbin/named-checkconf ] && [ -x /usr/sbin/named-checkzone ] && /usr/sbin/named-checkconf $ckcf_options ${named_conf} | cat ; then
return 0;
else
return 1;
fi
return $RETVAL
}
# See how we were called.
@ -239,27 +213,29 @@ case "$1" in
stop
;;
status)
rhstatus
rhstatus;
RETVAL=$?
;;
restart)
restart
;;
condrestart)
echo "condrestart option is obsolete. Use try-restart instead"
if [ -e /var/lock/subsys/named ]; then restart; fi
;;
try-restart)
if [ -e /var/lock/subsys/named ]; then restart; fi
;;
reload)
reload
;;
probe)
probe
;;
checkconfig|configtest|check|test)
checkconfig
force-reload)
if ! reload; then restart; fi
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|probe}"
exit 1
echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
exit 3
esac
exit $?
exit $RETVAL

View file

@ -1,9 +0,0 @@
$TTL 86400
@ IN SOA localhost. root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS localhost.
1 IN PTR localhost.

View file

@ -1,9 +0,0 @@
$TTL 86400
@ IN SOA localhost. root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS localhost.
1 IN PTR localhost.

View file

@ -1,48 +0,0 @@
// named.rfc1912.zones:
//
// Provided by Red Hat bind-config package
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
//
zone "." IN {
type hint;
file "named.ca";
};
zone "localdomain" IN {
type master;
file "localdomain.zone";
allow-update { none; };
};
zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};
zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
type master;
file "named.ip6.local";
allow-update { none; };
};
zone "255.in-addr.arpa" IN {
type master;
file "named.broadcast";
allow-update { none; };
};
zone "0.in-addr.arpa" IN {
type master;
file "named.zero";
allow-update { none; };
};

View file

@ -1,80 +0,0 @@
; This file holds the information on root name servers needed to
; initialize cache of Internet domain name servers
; (e.g. reference this file in the "cache . <file>"
; configuration file of BIND domain name servers).
;
; This file is made available by InterNIC
; under anonymous FTP as
; file /domain/named.cache
; on server FTP.INTERNIC.NET
; -OR- RS.INTERNIC.NET
;
; last update: Jan 29, 2004
; related version of root zone: 2004012900
;
;
; formerly NS.INTERNIC.NET
;
. 3600000 IN NS A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4
;
; formerly NS1.ISI.EDU
;
. 3600000 NS B.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET. 3600000 A 192.228.79.201
;
; formerly C.PSI.NET
;
. 3600000 NS C.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12
;
; formerly TERP.UMD.EDU
;
. 3600000 NS D.ROOT-SERVERS.NET.
D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90
;
; formerly NS.NASA.GOV
;
. 3600000 NS E.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10
;
; formerly NS.ISC.ORG
;
. 3600000 NS F.ROOT-SERVERS.NET.
F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241
;
; formerly NS.NIC.DDN.MIL
;
. 3600000 NS G.ROOT-SERVERS.NET.
G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4
;
; formerly AOS.ARL.ARMY.MIL
;
. 3600000 NS H.ROOT-SERVERS.NET.
H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53
;
; formerly NIC.NORDU.NET
;
. 3600000 NS I.ROOT-SERVERS.NET.
I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17
;
; operated by VeriSign, Inc.
;
. 3600000 NS J.ROOT-SERVERS.NET.
J.ROOT-SERVERS.NET. 3600000 A 192.58.128.30
;
; operated by RIPE NCC
;
. 3600000 NS K.ROOT-SERVERS.NET.
K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129
;
; operated by ICANN
;
. 3600000 NS L.ROOT-SERVERS.NET.
L.ROOT-SERVERS.NET. 3600000 A 198.32.64.12
;
; operated by WIDE
;
. 3600000 NS M.ROOT-SERVERS.NET.
M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33
; End of File

View file

@ -10,14 +10,4 @@
# OPTIONS="whatever" -- These additional options will be passed to named
# at startup. Don't add -t here, use ROOTDIR instead.
#
# ENABLE_ZONE_WRITE=yes -- If SELinux is disabled, then allow named to write
# its zone files and create files in its $ROOTDIR/var/named
# directory, necessary for DDNS and slave zone transfers.
# Slave zones should reside in the $ROOTDIR/var/named/slaves
# directory, in which case you would not need to enable zone
# writes. If SELinux is enabled, you must use only the
# 'named_write_master_zones' variable to enable zone writes.
#
# ENABLE_SDB=yes -- This enables use of 'named_sdb', which has support
# -- for the ldap, pgsql and dir zone database backends
# -- compiled in, to be used instead of named.
# KEYTAB_FILE="/dir/file" -- Specify named service keytab file (for GSS-TSIG)

View file

@ -1,8 +0,0 @@
$TTL 86400
@ IN SOA localhost. root.localhost. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS localhost.

View file

@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/bin/sh
#
# This script uses the named D-BUS support, which must be enabled in
# the running named with the named '-D' option, to get and print the
@ -9,12 +9,14 @@
#
# If no zone argument is specified, all forwarding zones will be listed.
#
# Usage: GetForwarders [-n -r] [ <zone> ]
# Usage: namedGetForwarders [-n -r] [ <zone> ]
# -n : output forward zone statements for named.conf
# -r : output in resolv.conf format
# : no -r or -n: just list the forwarders
#
# Copyright(C) Jason Vas Dias<jvdias@redhat.com> Red Hat Inc. 2005
# This script is based on perl script of Jason Vas Dias <jvdias@redhat.com>.
#
# Copyright(C) Baris Cicek <baris@nerd.com.tr> Nerd Software. 2007
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -26,98 +28,131 @@
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
use Getopt::Std;
%opts=();
declare -a zones;
declare -a servers;
declare -a ports;
declare -a only;
getopts("rn",\%opts);
output_format='plain';
zonecnt=0;
$zone = '';
if ( $#ARGV >= 0 )
{
$zone = "string:'". join("' string:'",@ARGV)."'";
};
function push () {
local array
array=( `echo $1` );
array[${#array[*]}]=$2;
echo ${array[@]};
}
@dn=();
function concat () {
local string
while [ $# -gt 0 ]; do
string=${string}$1;
shift;
done
echo $string;
}
open(DNS,
'/usr/bin/dbus-send --system --type=method_call --print-reply --reply-timeout=20000 '
.'--dest=com.redhat.named /com/redhat/named com.redhat.named.text.GetForwarders '
.$zone .'|'
) || die("dbus-send failed: $?: $!");
if [ $# -ge 0 ]; then
if [ "$1" == "-r" ]; then
output_format='resolv';
shift;
elif [ "$1" == "-n" ]; then
output_format='named';
shift;
fi
zone="";
for arg in $*; do
zone=$(push "$zone" " string:'$arg'");
done
fi
while(<DNS>)
{
$_=~s/[\s\r\n]+$//;
if ( /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/ )
{ # nameserver address
push @{${$dn[-1]}{'s'}}, { 'a' => "$1.$2.$3.$4" };
}elsif
( /\"(\d+)\"$/ )
{ # port
if ( $1 != 53 )
{
${@{${$dn[-1]}{'s'}}[-1]}{'p'} = $1;
};
}elsif
( /string\s+\"([^\"]+)\"$/ )
{
if ( ($1 eq 'first') || ($1 eq 'only') )
{ # policy
if( $1 eq 'only' )
{ # not default
${$dn[-1]}{'o'} = 1;
}
}else
{ # new DN - "zone"
push @dn, {'n'=>$1,'s'=>[]};
};
};
};
close(DNS);
DNS=`/bin/dbus-send --system --type=method_call --print-reply --reply-timeout=20000 --dest=com.redhat.named /com/redhat/named com.redhat.named.text.GetForwarders $zone`;
if( exists($opts{'r'}) )
{ # resolv.conf style:
my %svrs=();
print 'search ',
join( ' ',
grep { !( $_ =~ /\.in-addr\.arpa$/) }
map { ${$_}{'n'} }
@dn
),"\n",
'nameserver ',
join( "\nnameserver ",
grep { exists ( $svrs{ $_ } ) ? undef : { $svrs{$_}=$_ } }
map { ${$_}{'a'} }
map { @{${$_}{'s'}} } @dn
),"\n";
}elsif( exists($opts{'n'}) )
{ # named.conf style:
foreach $d (@dn)
{
print 'zone "',${$d}{'n'},'." IN { type forward; forwarders { ',
join("; ",
map { exists( ${$_}{'p'} )
? ${$_}{'a'} . ' port ' . ${$_}{'p'}
: ${$_}{'a'}
} @{${$d}{'s'}}
),
'; }; ',
exists(${$d}{'o'}) ? ' forward only; ' : '',
"};\n";
};
}else
{ # just list:
foreach $d (@dn)
{
print ${$d}{'n'}, "\n\t",
(exists(${$d}{'o'}) ? "forward only\n\t" : ''),
join( "\n\t",
map { exists( ${$_}{'p'} )
? ${$_}{'a'} . ':' . ${$_}{'p'}
: ${$_}{'a'}
} @{${$d}{'s'}}
),"\n";
};
};
if [ $? -ne 0 ]; then
echo -e "dbus-send failed: $? $!";
exit 1;
fi
IFS=$'\n'
for line in $DNS; do
match_ip=$( echo "$line" | awk --re-interval '{ match ($0, /([[:digit:]]{1,3})\.([[:digit:]]{1,3})\.([[:digit:]]{1,3})\.([[:digit:]]{1,3})/, a); printf "%s.%s.%s.%s", substr($0, a[1, "start"], a[1, "length"]), substr($0, a[2, "start"], a[2, "length"]), substr($0, a[3, "start"], a[3, "length"]), substr($0, a[4, "start"], a[4, "length"]);}' );
match_port=$( echo "$line" | awk '{ match ($0, /\"([[:digit:]]+)\"$/, a); printf "%s", substr($0, a[1, "start"], a[1,"length"]);}' );
match_string=$( echo "$line" | awk '{ match ($0, /string.+\"([^\"]+)\"$/, a); printf "%s", substr($0, a[1, "start"], a[1,"length"]);}' );
if [ "$match_ip" != "" ] && [ "$match_ip" != "..." ]; then
servers[$zonecnt]=$(push "${servers[$zonecnt]}" "$match_ip");
elif [ "$match_port" != "" ]; then
ports[$zonecnt]=$(push "${ports[$zonecnt]}" "$match_port");
elif [ "$match_string" == "only" ]; then
only[$zonecnt]="1";
elif [ "$match_string" != "" ] && [ "$match_string" != "first" ]; then
zonecnt=$((zonecnt + 1));
zones[$zonecnt]="$match_string";
fi
done
if [ "$output_format" == "resolv" ]; then
# resolv.conf style:
search_line='search';
nameserver_lines='';
for index in $(seq 1 $zonecnt); do
if [ "` echo ${zones[$index]} | awk ' /\.in-addr\.arpa$/ { print $0 }'`" == '' ]; then
search_line=$(push "$search_line" "${zones[$index]}");
fi
IFS=$' ';
for ns in ${servers[$index]}; do
nameserver_lines=$(concat "$nameserver_lines" "\nnameserver " "$ns");
done
done
echo -n $search_line;
echo -e $nameserver_lines;
elif [ "$output_format" == "named" ]; then
# named.conf style:
zone_lines='';
for index in $(seq 1 $zonecnt); do
zone_line=$(concat 'zone "' "${zones[$index]}" '." IN { type forward; forwarders { ');
srvcnt=1;
IFS=$' ';
for ns in ${servers[$index]}; do
srvport=$(eval "echo ${ports[$index]} | awk '{ print \$${srvcnt} }'");
if [ "$srvport" != "53" ]; then
zone_line=$(concat "$zone_line" " $ns port $srvport;");
else
zone_line=$(concat "$zone_line" " $ns;");
fi
srvcnt=$((srvcnt+1));
done
zone_line=$(concat "$zone_line" " };");
if [ "${only[$index]}" == '1' ]; then
zone_line=$(concat "$zone_line" " forward only;");
fi
zone_line=$(concat "$zone_line" " };");
zone_lines=$(concat "$zone_lines" "$zone_line\n");
done
echo -e ${zone_lines%\\n};
elif [ "$output_format" == "plain" ]; then
# just list:
output='';
for index in $(seq 1 $zonecnt); do
output=$(concat "$output" "${zones[$index]}" "\n");
if [ "${only[$index]}" == "1" ]; then
output=$(concat "$output" "\t" "forward only" "\n");
fi
srvcnt=1;
IFS=$' ';
for ns in ${servers[$index]}; do
srvport=$(eval "echo ${ports[$index]} | awk '{ print \$${srvcnt} }'");
if [ "$srvport" != "53" ]; then
output=$(concat "$output" "\t" "$ns:$srvport" "\n");
else
output=$(concat "$output" "\t" "$ns" "\n");
fi
srvcnt=$((srvcnt+1));
done
done
echo -e ${output%\\n};
fi

View file

@ -1,3 +1,4 @@
3567c35a24cb83a8a69443a399bbb6c8 bind-chroot.tar.gz
16c893f73a394c8cc36d7900cb9bb801 bind-9.5.0-P2.tar.gz
9c3905b6aece5b4aa0deba6029437483 config-2.tar
4faa4395b955e5f8a3d50f308b9fabc8 bind-chroot.tar.bz2
13fef79f99fcefebb51d84b08805de51 libbind-man.tar.gz
55e709501a7780233c36e25ccd15ece2 bind-9.3.2.tar.gz