diff options
author | Jakob Schlyter <jakob@cvs.openbsd.org> | 2004-09-28 16:48:21 +0000 |
---|---|---|
committer | Jakob Schlyter <jakob@cvs.openbsd.org> | 2004-09-28 16:48:21 +0000 |
commit | f8cf3a1e10132d9a4e78a4b974af9a00db94d722 (patch) | |
tree | a2ddae3d2ec5d7442368ce8bdeb0b4d7e61f91ae | |
parent | e394444e3d65f8eacd2ae338db53f48e478804c5 (diff) |
remove unused files
-rw-r--r-- | usr.sbin/bind/EXCLUDED | 162 | ||||
-rw-r--r-- | usr.sbin/bind/bin/dig/nslookup.8 | 449 | ||||
-rw-r--r-- | usr.sbin/bind/bin/tests/names/dns_label_countbits_data | 7 | ||||
-rw-r--r-- | usr.sbin/bind/bin/tests/names/dns_label_getbit_data | 10 | ||||
-rw-r--r-- | usr.sbin/bind/bin/tests/nxtify.c | 215 | ||||
-rw-r--r-- | usr.sbin/bind/bin/tests/system/stress/ns1/root.db | 57 | ||||
-rw-r--r-- | usr.sbin/bind/bin/tests/system/xfer/knowngood.dig.out | 105 | ||||
-rw-r--r-- | usr.sbin/bind/bin/tests/system/xfer/ns2/example.db | 159 | ||||
-rw-r--r-- | usr.sbin/bind/bin/tests/system/xfer/ns2/tsigzone.db | 159 | ||||
-rw-r--r-- | usr.sbin/bind/lib/dns/a6.c | 237 | ||||
-rw-r--r-- | usr.sbin/bind/lib/dns/include/dns/a6.h | 82 | ||||
-rw-r--r-- | usr.sbin/bind/lib/dns/include/dns/nxt.h | 68 | ||||
-rw-r--r-- | usr.sbin/bind/lib/dns/nxt.c | 186 | ||||
-rw-r--r-- | usr.sbin/bind/lib/isccfg/check.c | 691 | ||||
-rw-r--r-- | usr.sbin/bind/lib/isccfg/include/isccfg/check.h | 54 |
15 files changed, 0 insertions, 2641 deletions
diff --git a/usr.sbin/bind/EXCLUDED b/usr.sbin/bind/EXCLUDED deleted file mode 100644 index eecb1f9d6ce..00000000000 --- a/usr.sbin/bind/EXCLUDED +++ /dev/null @@ -1,162 +0,0 @@ - -1007. [port] config.guess, config.sub from autoconf-2.52. - -1008. [port] libtool.m4, ltmain.sh from libtool-1.4.2. - -1009. [port] OpenUNIX 8 support. [RT #1728] - -1011. [cleanup] Removed isc_dir_current(). - -1024. [port] Compilation failed on HP-UX 11.11 due to - incompatible use of the SIOCGLIFCONF macro - name. [RT #1831] - [needs more work] - -1025. [bug] Don't use multicast addresses to resolve iterative - queries. [RT #101] - -1034. [bug] Ignore the RD bit on multicast queries as specified - in RFC 1123. [RT #137] - -1035. [bug] If we respond to multicast queries (which we - currently do not), respond from a unicast address - as specified in RFC 1123. [RT #137] - -1037. [bug] Negative responses whose authority section contain - SOA or NS records whose owner names are not equal - equal to or parents of the query name should be - rejected. [RT #1862] - -1073. [bug] The ADB cache cleaning should also be space driven. - [RT #1915, #1938] - [ New function dns_adb_setadbsize() ] - -1079. [bug] BIND 8 compatibility: accept bare elements at top - level of sort list treating them as if they were - a single element list. [RT #1963] - -1080. [bug] BIND 8 compatibility: accept bare IP prefixes - as the second element of a two-element top level - sort list statement. [RT #1964] - -1105. [port] OpenUNIX 8 enable threads by default. [RT #1970] - [Functional change] - -1110. [bug] dig should only accept valid abbreviations of +options. - [RT #2003] - [Potentially breaks scripts. Leave to 9.3.0.] - -1143. [bug] When a trusted-keys statement was present and named - was built without crypto support, it would leak memory. - [ Not applicable to 9.2 ] - -1150. [bug] named incorrectly accepted TTL values - containing plus or minus signs, such as - 1d+1h-1s. - [ Uses new function isc_parse_uint32() ] - -1151. [bug] nslookup failed to check that the arguments to - the port, timeout, and retry options were - valid integers and in range. [RT #2099] - [ Uses new function isc_parse_uint32() ] - -1159. [bug] MD and MF are not permitted to be loaded by RFC1123 - [ Could cause zones that loaded in 9.2.0 to fail - to load. Leave such breakages to 9.3.0. ] - -1187. [bug] named was incorrectly returning DNSSEC records - in negative responses when the DO bit was not set. - [ Requires API change (new argument) to - dns_rdataset_towire(), dns_rdataset_towirepartial() - and dns_rdataset_towirepartial() ] - -1192. [bug] The seconds fields in LOC records were restricted - to three decimal places. More decimal places should - be allowed but warned about. - -1209. [bug] Dig, host, nslookup were not checking the message ids - on the responses. [RT #2454] - -1224. [bug] 'rrset-order' and 'sortlist' should be additive - not exclusive. - [tightly coupled with 'cyclic' and 'random' support] - -1233. [bug] The flags field of a KEY record can be expressed in - hex as well as decimal. - [ Not applicable to 9.2.x ] - -1234. [bug] contrib/sdb: 'zonetodb' failed to call - dns_result_register(). DNS_R_SEENINCLUDE should not - be fatal. - -1243. [bug] It was possible to trigger a REQUIRE() in - dns_message_findtype(). [RT #2659] - -1247. [bug] Don't reset the interface index for link/site local - addresses. [RT #2576] - [depends on new functions] - -1255. [bug] When verifying that an NXT proves nonexistence, check - the rcode of the message and only do the matching NXT - check. That is, for NXDOMAIN responses, check that - the name is in the range between the NXT owner and - next name, and for NOERROR NODATA responses, check - that the type is not present in the NXT bitmap. - [required changes from DS support] - -1271. [bug] "recursion available: {denied,approved}" was too - confusing. - -1321. [bug] If the last RRset in a zone is glue, dnssec-signzone - would incorrectly duplicate its output and sign it. - [DS specific] - -1322. [bug] dnssec-signzone usage message was misleading. - [DS specific] - -1328. [bug] The validator could incorrectly verify an invalid - negative proof. - [DS specific] - -1355. [bug] Fix DNSSEC wildcard proof for CNAME/DNAME. - -1362. [bug] remove IFF_RUNNING test when scanning interfaces. - -1371. [bug] notify-source-v6, transfer-source-v6 and - query-source-v6 with explicit addresses and using the - same ports as named was listening on could interfere - with nameds ability to answer queries sent to those - addresses. - -1386. [bug] named-checkzone -z stopped on errors in a zone. - [RT #3653] - -1392. [bug] named-checkzone: update usage. - -1393. [port] Bind to individual IPv6 interfaces if IPV6_IPV6ONLY - is not available in the kernel to prevent accidently - listening on IPv4 interfaces. - -1398. [doc] ARM: notify-also should have been also-notify. - [RT #4345] - -1400. [bug] Block the addition of wildcard NS records by IXFR - or UPDATE. [RT #3502] - -1404. [bug] libbind: ns_name_ntol() could overwrite a zero length - buffer. - -1409. [bug] DS should have attribute DNS_RDATATYPEATTR_DNSSEC. - -1430. [port] linux: IPv6 interface scanning support. - -1433. [bug] named could trigger a REQUIRE failure if it could - not get a file descriptor when attempting to write - a master file. [RT #4347] - -1454. [port] Use getifaddrs() if available for interface scanning. - --disable-getifaddrs to override. Glibc currently - has a getifaddrs() that does not support IPv6. - Use --enable-getifaddrs=glibc to force the use of - this version under linux machines. - diff --git a/usr.sbin/bind/bin/dig/nslookup.8 b/usr.sbin/bind/bin/dig/nslookup.8 deleted file mode 100644 index 207ae19e289..00000000000 --- a/usr.sbin/bind/bin/dig/nslookup.8 +++ /dev/null @@ -1,449 +0,0 @@ -.\" $OpenBSD: nslookup.8,v 1.5 2003/07/02 08:19:58 jmc Exp $ -.\" -.\" ++Copyright++ 1985, 1989 -.\" - -.\" Copyright (c) 1985, 1989 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" - -.\" Portions Copyright (c) 1993 by Digital Equipment Corporation. -.\" -.\" 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, and that -.\" the name of Digital Equipment Corporation not be used in advertising or -.\" publicity pertaining to distribution of the document or software without -.\" specific, written prior permission. -.\" -.\" THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL -.\" WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT -.\" CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL -.\" DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR -.\" PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS -.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -.\" SOFTWARE. -.\" - -.\" --Copyright-- -.\" -.\" @(#)nslookup.8 5.3 (Berkeley) 6/24/90 -.\" -.Dd June 24, 1990 -.Dt NSLOOKUP 8 -.Os -.Sh NAME -.Nm nslookup -.Nd query Internet name servers interactively -.Sh SYNOPSIS -.Nm nslookup -.Op Fl option Ar ... -.Op Ar host-to-find | Fl Op Ar server -.Sh DESCRIPTION -.Ic Nslookup -is a program to query Internet domain name servers. -.Ic Nslookup -has two modes: interactive and non-interactive. -Interactive mode allows the user to query name servers for -information about various hosts and domains or to print a list of hosts -in a domain. -Non-interactive mode is used to print just the name and requested information -for a host or domain. -.Sh ARGUMENTS -Interactive mode is entered in the following cases: -.Bl -tag -width "a) " -.It a) -when no arguments are given (the default name server will be used), -.It b) -when the first argument is a hyphen (-) and the second argument -is the host name or Internet address of a name server. -.El -.Pp -Non-interactive mode is used when the name or Internet address -of the host to be looked up -is given as the first argument. -The optional second argument specifies -the host name or address of a name server. -.Pp -The options listed under the -.Dq Li set -command below can be specified in -the -.Pa .nslookuprc -file in the user's home directory if they are listed -one per line. -Options can also be specified -on the command line if they precede the arguments and are prefixed with -a hyphen. -For example, to change the default query type to host information, -and the initial timeout to 10 seconds, type: -.Bd -literal -offset indent - nslookup -query=hinfo -timeout=10 -.Ed -.Sh INTERACTIVE COMMANDS -Commands may be interrupted at any time by typing a control-C. -To exit, type a control-D -.Pq Dv EOF -or type -.Li exit . -The command line length must be less than 256 characters. -To treat a built-in command as a host name, -precede it with an escape character -.Pq Sq \e . -.Sy "N.B.: An unrecognized command will be interpreted as a host name." -.Bl -tag -width "lserver" -.It Ar host Op Ar server -Look up information for -.Ar host -using the current default server or using -.Ar server , -if specified. -If -.Ar host -is an Internet address and the query type is -.Dv A -or -.Dv PTR , -the name of the host is returned. -If -.Ar host -is a name and does not have a trailing period, the default -domain name is appended to the name. -(This behavior depends on the state of the -.Ic set -options -.Ic domain , srchlist , defname , -and -.Ic search . ) -.Pp -To look up a host not in the current domain, append a period to -the name. -.It Ic server Ar domain -.It Ic lserver Ar domain -Change the default server to -.Ar domain ; -.Ic lserver -uses the initial server to look up information about -.Ar domain , -while -.Ic server -uses the current default server. -If an authoritative answer can't be found, the names of servers -that might have the answer are returned. -.It Ic exit -Exits the program. -.It Xo -.Ic set -.Ar keyword Ns Op = Ns Ar value -.Xc -This command is used to change state information that affects the lookups. -Valid keywords are: -.Bl -tag -width "class=v" -.It Ic all -Prints the current values of the frequently used options to -.Ic set . -Information about the current default server and host is also printed. -.It Ic class Ns = Ns Ar value -Change the query class to one of: -.Bl -tag -width "HESIOD " -.It Dv IN -the Internet class -.It Dv CHAOS -the Chaos class -.It Dv HESIOD -the MIT Athena Hesiod class -.It Dv ANY -wildcard (any of the above) -.El -.Pp -The class specifies the protocol group of the information. -.Pp -(Default = -.Dv IN ; -abbreviation = -.Ic cl ) -.It Xo -.Oo Ic no Oc Ns Ic debug -.Xc -Turn debugging mode on. -A lot more information is printed about the -packet sent to the server and the resulting answer. -.Pp -(Default = -.Ic nodebug ; -abbreviation = -.Oo Ic no Oc Ns Ic deb ) -.It Xo -.Oo Ic no Oc Ns Ic d2 -.Xc -Turn exhaustive debugging mode on. -Essentially all fields of every packet are printed. -.Pp -(Default = -.Ic nod2 ) -.It Ic domain Ns = Ns Ar name -Change the default domain name to -.Ar name . -The default domain name is appended to a lookup request depending on the -state of the -.Ic defname -and -.Ic search -options. -The domain search list contains the parents of the default domain if it has -at least two components in its name. -For example, if the default domain -is CC.Berkeley.EDU, the search list is CC.Berkeley.EDU and Berkeley.EDU. -Use the -.Dq Ic set srchlist -command to specify a different list. -Use the -.Dq Ic set all -command to display the list. -.Pp -(Default = value from -.Xr hostname 1 , -.Pa /etc/resolv.conf , -or -.Ev LOCALDOMAIN ; -abbreviation = -.Ic do ) -.It Xo -.Sm off -.Ic srchlist No = -.Ar name1 No / -.Ar name2 No / -.Ar ... -.Sm on -.Xc -Change the default domain name to -.Ar name1 -and the domain search list -to -.Ar name1 , name2 , -etc. -A maximum of 6 names separated by slashes (/) -can be specified. -For example, -.Bd -literal -offset indent -set srchlist=lcs.MIT.EDU/ai.MIT.EDU/MIT.EDU -.Ed -.Pp -sets the domain to lcs.MIT.EDU and the search list to the three names. -This command overrides the -default domain name and search list of the -.Dq Ic set domain -command. -Use the -.Dq Ic set all -command to display the list. -.Pp -(Default = value based on -.Xr hostname 1 , -.Pa /etc/resolv.conf , -or -.Ev LOCALDOMAIN ; -abbreviation = -.Ic srchl ) -.It Xo -.Oo Ic no Oc Ns Ic defname -.Xc -If set, append the default domain name to a single-component lookup request -(i.e., one that does not contain a period). -.Pp -(Default = -.Ic defname ; -abbreviation = -.Oo Ic no Oc Ns Ic defname ) -.It Xo -.Oo Ic no Oc Ns Ic search -.Xc -If the lookup request contains at least one period but -.Em doesn't -end with a trailing period, append the domain names in the domain search list -to the request until an answer is received. -.Pp -(Default = -.Ic search ; -abbreviation = -.Oo Ic no Oc Ns Ic sea ) -.It Ic port Ns = Ns Ar value -Change the default TCP/UDP name server port to -.Ar value . -.Pp -(Default = 53; -abbreviation = -.Ic \&po ) -.It Ic querytype Ns = Ns Ar value -.It Ic type Ns = Ns Ar value -Change the type of information query to one of: -.Bl -tag -width "HINFO " -.It Dv A -the host's Internet address. -.It Dv CNAME -the canonical name for an alias. -.It Dv HINFO -the host CPU and operating system type. -.It Dv MINFO -the mailbox or mail list information. -.It Dv MX -the mail exchanger. -.It Dv NS -the name server for the named zone. -.It Dv PTR -the host name if the query is an Internet address; -otherwise, the pointer to other information. -.It Dv SOA -the domain's -.Dq start-of-authority -information. -.It Dv TXT -the text information. -.It Dv UINFO -the user information. -.It Dv WKS -the supported well-known services. -.El -.Pp -Other types -.Dv ( ANY , AXFR , MB , -.Dv MD , MF , NULL ) -are described in the RFC-1035 document. -.Pp -(Default = -.Dv A ; -abbreviations = -.Ic q , ty ) -.It Xo -.Oo Ic no Oc Ns Ic recurse -.Xc -Tell the name server to query other servers if it does not have the -information. -.Pp -(Default = -.Ic recurse ; -abbreviation = -.Oo Ic no Oc Ns Ic rec ) -.It Ic retry Ns = Ns Ar number -Set the number of retries to -.Ar number . -When a reply to a request is not received within a certain -amount of time (changed with -.Dq Ic set timeout ) , -the timeout period is doubled and the request is resent. -The retry value controls how many times a request is resent before giving up. -.Pp -(Default = 4, abbreviation = -.Ic ret ) -.It Ic root Ns = Ns Ar host -Change the name of the root server to -.Ar host . -This affects the -.Dq Ic root -command. -.Pp -(Default = -.Ic ns.internic.net. ; -abbreviation = -.Ic ro ) -.It Ic timeout Ns = Ns Ar number -Change the initial timeout interval for waiting for a reply to -.Ar number -seconds. -Each retry doubles the timeout period. -.Pp -(Default = 5 seconds; abbreviation = -.Ic ti ) -.It Xo -.Oo Ic no Oc Ns Ic vc -.Xc -Always use a virtual circuit when sending requests to the server. -.Pp -(Default = -.Ic novc ; -abbreviation = -.Oo Ic no Oc Ns Ic v ) -.El -.El -.Sh FILES -.Bl -tag -width "/etc/resolv.confXXX" -compact -.It Pa /etc/resolv.conf -initial domain name and name server addresses -.El -.Sh DIAGNOSTICS -If the lookup request was not successful, an error message is printed. -Possible errors are: -.Bl -tag -width "Timed" -.It Li Timed out -The server did not respond to a request after a certain amount of -time (changed with -.Dq Ic set timeout Ns = Ns Ar value ) -and a certain number of retries (changed with -.Do -.Ic set retry Ns = Ns Ar value -.Dc ) . -.It Li \&No response from server -No name server is running on the server machine. -.It Li \&No records -The server does not have resource records of the current query type for the -host, although the host name is valid. -The query type is specified with the -.Dq Ic set querytype -command. -.It Li Non-existent domain -The host or domain name does not exist. -.It Li Connection refused -.It Li Network is unreachable -The connection to the name or finger server could not be made -at the current time. -This error commonly occurs with -.Ic ls -and -.Ic finger -requests. -.It Li Server failure -The name server found an internal inconsistency in its database -and could not return a valid answer. -.It Li Refused -The name server refused to service the request. -.It Li Format error -The name server found that the request packet was not in the proper format. -It may indicate an error in -.Nm nslookup . -.El -.Sh SEE ALSO -.Xr dig 1 , -.Xr resolver 3 , -.Xr resolver 5 , -.Xr named 8 -.Pp -.Bl -tag -width "RFC 1034 " -compact -.It RFC 1034 -Domain Names \- Concepts and Facilities -.It RFC 1035 -Domain Names \- Implementation and Specification -.El -.Sh AUTHORS -Andrew Cherenson diff --git a/usr.sbin/bind/bin/tests/names/dns_label_countbits_data b/usr.sbin/bind/bin/tests/names/dns_label_countbits_data deleted file mode 100644 index 0888eff5ac6..00000000000 --- a/usr.sbin/bind/bin/tests/names/dns_label_countbits_data +++ /dev/null @@ -1,7 +0,0 @@ -# -# format of file is <testname> <tab> <bitlabel_pos> <tab> <expected_bits> -# -\[x42/7] 0 7 -a.b.c.\[x42/7] 3 7 -\[o033/9] 0 9 -\[b01001/5] 0 5 diff --git a/usr.sbin/bind/bin/tests/names/dns_label_getbit_data b/usr.sbin/bind/bin/tests/names/dns_label_getbit_data deleted file mode 100644 index 51240432b38..00000000000 --- a/usr.sbin/bind/bin/tests/names/dns_label_getbit_data +++ /dev/null @@ -1,10 +0,0 @@ -# -# format is: -# <testname> <tab> <labelpos> <tab> <bitpos> <tab> <expected value> -# -\[x42/7] 0 6 1 -a.b.c.\[x42/7] 3 5 0 -\[o033/9] 0 2 0 -\[o033/9] 0 3 0 -\[o033/9] 0 4 1 -\[b0101/4] 0 1 1 diff --git a/usr.sbin/bind/bin/tests/nxtify.c b/usr.sbin/bind/bin/tests/nxtify.c deleted file mode 100644 index 2a0d9c4ee7f..00000000000 --- a/usr.sbin/bind/bin/tests/nxtify.c +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * 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. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM - * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL - * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION - * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* $ISC: nxtify.c,v 1.19 2001/01/09 21:41:26 bwelling Exp $ */ - -#include <config.h> - -#include <stdlib.h> - -#include <isc/mem.h> -#include <isc/string.h> - -#include <dns/db.h> -#include <dns/dbiterator.h> -#include <dns/fixedname.h> -#include <dns/nxt.h> -#include <dns/rdataset.h> -#include <dns/rdatasetiter.h> -#include <dns/result.h> - -static isc_mem_t *mctx = NULL; - -static inline void -fatal(const char *message) { - fprintf(stderr, "%s\n", message); - exit(1); -} - -static inline void -check_result(isc_result_t result, const char *message) { - if (result != ISC_R_SUCCESS) { - fprintf(stderr, "%s: %s\n", message, - isc_result_totext(result)); - exit(1); - } -} - -static inline isc_boolean_t -active_node(dns_db_t *db, dns_dbversion_t *version, dns_dbnode_t *node) { - dns_rdatasetiter_t *rdsiter; - isc_boolean_t active = ISC_FALSE; - isc_result_t result; - dns_rdataset_t rdataset; - - dns_rdataset_init(&rdataset); - rdsiter = NULL; - result = dns_db_allrdatasets(db, node, version, 0, &rdsiter); - check_result(result, "dns_db_allrdatasets()"); - result = dns_rdatasetiter_first(rdsiter); - while (result == ISC_R_SUCCESS) { - dns_rdatasetiter_current(rdsiter, &rdataset); - if (rdataset.type != dns_rdatatype_nxt) - active = ISC_TRUE; - dns_rdataset_disassociate(&rdataset); - if (!active) - result = dns_rdatasetiter_next(rdsiter); - else - result = ISC_R_NOMORE; - } - if (result != ISC_R_NOMORE) - fatal("rdataset iteration failed"); - dns_rdatasetiter_destroy(&rdsiter); - - if (!active) { - /* - * Make sure there is no NXT record for this node. - */ - result = dns_db_deleterdataset(db, node, version, - dns_rdatatype_nxt, 0); - if (result == DNS_R_UNCHANGED) - result = ISC_R_SUCCESS; - check_result(result, "dns_db_deleterdataset"); - } - - return (active); -} - -static inline isc_result_t -next_active(dns_db_t *db, dns_dbversion_t *version, dns_dbiterator_t *dbiter, - dns_name_t *name, dns_dbnode_t **nodep) -{ - isc_result_t result; - isc_boolean_t active; - - do { - active = ISC_FALSE; - result = dns_dbiterator_current(dbiter, nodep, name); - if (result == ISC_R_SUCCESS) { - active = active_node(db, version, *nodep); - if (!active) { - dns_db_detachnode(db, nodep); - result = dns_dbiterator_next(dbiter); - } - } - } while (result == ISC_R_SUCCESS && !active); - - return (result); -} - -static void -nxtify(char *filename) { - isc_result_t result; - dns_db_t *db; - dns_dbversion_t *wversion; - dns_dbnode_t *node, *nextnode; - char *origintext; - dns_fixedname_t fname, fnextname; - dns_name_t *name, *nextname, *target; - isc_buffer_t b; - size_t len; - dns_dbiterator_t *dbiter; - char newfilename[1024]; - - dns_fixedname_init(&fname); - name = dns_fixedname_name(&fname); - dns_fixedname_init(&fnextname); - nextname = dns_fixedname_name(&fnextname); - - origintext = strrchr(filename, '/'); - if (origintext == NULL) - origintext = filename; - else - origintext++; /* Skip '/'. */ - len = strlen(origintext); - isc_buffer_init(&b, origintext, len); - isc_buffer_add(&b, len); - result = dns_name_fromtext(name, &b, dns_rootname, ISC_FALSE, NULL); - check_result(result, "dns_name_fromtext()"); - - db = NULL; - result = dns_db_create(mctx, "rbt", name, dns_dbtype_zone, - dns_rdataclass_in, 0, NULL, &db); - check_result(result, "dns_db_create()"); - result = dns_db_load(db, filename); - if (result == DNS_R_SEENINCLUDE) - result = ISC_R_SUCCESS; - check_result(result, "dns_db_load()"); - wversion = NULL; - result = dns_db_newversion(db, &wversion); - check_result(result, "dns_db_newversion()"); - dbiter = NULL; - result = dns_db_createiterator(db, ISC_FALSE, &dbiter); - check_result(result, "dns_db_createiterator()"); - result = dns_dbiterator_first(dbiter); - node = NULL; - result = next_active(db, wversion, dbiter, name, &node); - while (result == ISC_R_SUCCESS) { - nextnode = NULL; - result = dns_dbiterator_next(dbiter); - if (result == ISC_R_SUCCESS) - result = next_active(db, wversion, dbiter, nextname, - &nextnode); - if (result == ISC_R_SUCCESS) - target = nextname; - else if (result == ISC_R_NOMORE) - target = dns_db_origin(db); - else { - target = NULL; /* Make compiler happy. */ - fatal("db iteration failed"); - } - dns_nxt_build(db, wversion, node, target, 3600); /* XXX BEW */ - dns_db_detachnode(db, &node); - node = nextnode; - } - if (result != ISC_R_NOMORE) - fatal("db iteration failed"); - dns_dbiterator_destroy(&dbiter); - /* - * XXXRTH For now, we don't increment the SOA serial. - */ - dns_db_closeversion(db, &wversion, ISC_TRUE); - len = strlen(filename); - if (len + 4 + 1 > sizeof newfilename) - fatal("filename too long"); - snprintf(newfilename, sizeof(newfilename), "%s.new", filename); - result = dns_db_dump(db, NULL, newfilename); - check_result(result, "dns_db_dump"); - dns_db_detach(&db); -} - -int -main(int argc, char *argv[]) { - int i; - isc_result_t result; - - dns_result_register(); - - result = isc_mem_create(0, 0, &mctx); - check_result(result, "isc_mem_create()"); - - argc--; - argv++; - - for (i = 0; i < argc; i++) - nxtify(argv[i]); - - /* isc_mem_stats(mctx, stdout); */ - isc_mem_destroy(&mctx); - - return (0); -} diff --git a/usr.sbin/bind/bin/tests/system/stress/ns1/root.db b/usr.sbin/bind/bin/tests/system/stress/ns1/root.db deleted file mode 100644 index b34dcda1a4d..00000000000 --- a/usr.sbin/bind/bin/tests/system/stress/ns1/root.db +++ /dev/null @@ -1,57 +0,0 @@ -; Copyright (C) 2000, 2001 Internet Software Consortium. -; -; 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. -; -; THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM -; DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL -; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL -; INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, -; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING -; FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, -; NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION -; WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -; $ISC: root.db,v 1.2 2001/01/09 21:44:49 bwelling Exp $ - - 300 -. IN SOA gson.nominum.com. a.root.servers.nil. ( - 2000042100 ; serial - 600 ; refresh - 600 ; retry - 1200 ; expire - 600 ; minimum - ) -. NS a.root-servers.nil. -a.root-servers.nil. A 10.53.0.1 -zone000000.example. NS ns2.zone000000.example. -ns2.zone000000.example. A 10.53.0.2 -zone000000.example. NS ns3.zone000000.example. -ns3.zone000000.example. A 10.53.0.3 -zone000000.example. NS ns4.zone000000.example. -ns4.zone000000.example. A 10.53.0.4 -zone000001.example. NS ns2.zone000001.example. -ns2.zone000001.example. A 10.53.0.2 -zone000001.example. NS ns3.zone000001.example. -ns3.zone000001.example. A 10.53.0.3 -zone000001.example. NS ns4.zone000001.example. -ns4.zone000001.example. A 10.53.0.4 -zone000002.example. NS ns2.zone000002.example. -ns2.zone000002.example. A 10.53.0.2 -zone000002.example. NS ns3.zone000002.example. -ns3.zone000002.example. A 10.53.0.3 -zone000002.example. NS ns4.zone000002.example. -ns4.zone000002.example. A 10.53.0.4 -zone000003.example. NS ns2.zone000003.example. -ns2.zone000003.example. A 10.53.0.2 -zone000003.example. NS ns3.zone000003.example. -ns3.zone000003.example. A 10.53.0.3 -zone000003.example. NS ns4.zone000003.example. -ns4.zone000003.example. A 10.53.0.4 -zone000004.example. NS ns2.zone000004.example. -ns2.zone000004.example. A 10.53.0.2 -zone000004.example. NS ns3.zone000004.example. -ns3.zone000004.example. A 10.53.0.3 -zone000004.example. NS ns4.zone000004.example. -ns4.zone000004.example. A 10.53.0.4 diff --git a/usr.sbin/bind/bin/tests/system/xfer/knowngood.dig.out b/usr.sbin/bind/bin/tests/system/xfer/knowngood.dig.out deleted file mode 100644 index 199398a2f9e..00000000000 --- a/usr.sbin/bind/bin/tests/system/xfer/knowngood.dig.out +++ /dev/null @@ -1,105 +0,0 @@ -example. 300 IN SOA ns2.example. hostmaster.example. 2000042795 20 20 1814400 3600 -example. 300 IN NS ns2.example. -example. 300 IN NS ns3.example. -*.example. 300 IN MX 10 mail.example. -a.example. 300 IN TXT "foo foo foo" -a.example. 300 IN PTR foo.net. -a01.example. 3600 IN A 0.0.0.0 -a02.example. 3600 IN A 255.255.255.255 -a601.example. 3600 IN A6 0 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff -a601.example. 3600 IN A6 64 ::ffff:ffff:ffff:ffff foo. -a601.example. 3600 IN A6 127 ::1 foo. -a601.example. 3600 IN A6 128 . -afsdb01.example. 3600 IN AFSDB 0 hostname.example. -afsdb02.example. 3600 IN AFSDB 65535 . -b.example. 300 IN CNAME foo.net. -c.example. 300 IN A 73.80.65.49 -cert01.example. 3600 IN CERT 65534 65535 PRIVATEOID MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgiWCn/GxHhai6V AuHAoNUz4YoU1tVfSCSqQYn6//11U6Nld80jEeC8aTrO+KKmCaY= -cname01.example. 3600 IN CNAME cname-target. -cname02.example. 3600 IN CNAME cname-target.example. -cname03.example. 3600 IN CNAME . -d.example. 300 IN A 73.80.65.49 -dname01.example. 3600 IN DNAME dname-target. -dname02.example. 3600 IN DNAME dname-target.example. -dname03.example. 3600 IN DNAME . -e.example. 300 IN MX 10 mail.example. -e.example. 300 IN TXT "one" -e.example. 300 IN TXT "three" -e.example. 300 IN TXT "two" -e.example. 300 IN A 73.80.65.49 -e.example. 300 IN A 73.80.65.50 -e.example. 300 IN A 73.80.65.52 -e.example. 300 IN A 73.80.65.51 -f.example. 300 IN A 73.80.65.52 -gpos01.example. 3600 IN GPOS "-22.6882" "116.8652" "250.0" -gpos02.example. 3600 IN GPOS "" "" "" -hinfo01.example. 3600 IN HINFO "Generic PC clone" "NetBSD-1.4" -hinfo02.example. 3600 IN HINFO "PC" "NetBSD" -isdn01.example. 3600 IN ISDN "isdn-address" -isdn02.example. 3600 IN ISDN "isdn-address" "subaddress" -isdn03.example. 3600 IN ISDN "isdn-address" -isdn04.example. 3600 IN ISDN "isdn-address" "subaddress" -key01.example. 3600 IN KEY 512 255 1 AQMFD5raczCJHViKtLYhWGz8hMY9UGRuniJDBzC7w0aRyzWZriO6i2od GWWQVucZqKVsENW91IOW4vqudngPZsY3GvQ/xVA8/7pyFj6b7Esga60z yGW6LFe9r8n6paHrlG5ojqf0BaqHT+8= -kx01.example. 3600 IN KX 10 kdc.example. -kx02.example. 3600 IN KX 10 . -loc01.example. 3600 IN LOC 60 9 0.000 N 24 39 0.000 E 10.00m 20m 2000m 20m -loc02.example. 3600 IN LOC 60 9 0.000 N 24 39 0.000 E 10.00m 20m 2000m 20m -mb01.example. 3600 IN MG madname.example. -mb02.example. 3600 IN MG . -md01.example. 3600 IN MD madname.example. -md01.example. 3600 IN MD . -mf01.example. 3600 IN MF madname.example. -mf01.example. 3600 IN MF . -mg01.example. 3600 IN MG mgmname.example. -mg02.example. 3600 IN MG . -minfo01.example. 3600 IN MINFO rmailbx.example. emailbx.example. -minfo02.example. 3600 IN MINFO . . -mr01.example. 3600 IN MR mrname.example. -mr02.example. 3600 IN MR . -mx01.example. 3600 IN MX 10 mail.example. -mx02.example. 3600 IN MX 10 . -naptr01.example. 3600 IN NAPTR 0 0 "" "" "" . -naptr02.example. 3600 IN NAPTR 65535 65535 "blurgh" "blorf" "blegh" foo. -ns2.example. 300 IN A 10.53.0.2 -ns3.example. 300 IN A 10.53.0.3 -nsap-ptr01.example. 3600 IN NSAP-PTR foo. -nsap-ptr01.example. 3600 IN NSAP-PTR . -nsap01.example. 3600 IN NSAP 0x47000580005a0000000001e133ffffff00016100 -nsap02.example. 3600 IN NSAP 0x47000580005a0000000001e133ffffff00016100 -nxt01.example. 3600 IN NXT a.secure.example. NS SOA MX SIG KEY LOC NXT -nxt02.example. 3600 IN NXT . NSAP-PTR NXT -nxt03.example. 3600 IN NXT . A -nxt04.example. 3600 IN NXT . 127 -ptr01.example. 3600 IN PTR example. -px01.example. 3600 IN PX 65535 foo. bar. -px02.example. 3600 IN PX 65535 . . -rp01.example. 3600 IN RP mbox-dname.example. txt-dname.example. -rp02.example. 3600 IN RP . . -rt01.example. 3600 IN RT 0 intermediate-host.example. -rt02.example. 3600 IN RT 65535 . -s.example. 300 IN NS ns.s.example. -ns.s.example. 300 IN A 73.80.65.49 -sig01.example. 3600 IN SIG NXT 1 3 3600 20000102030405 19961211100908 2143 foo.example. MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgiWCn/GxHhai6V AuHAoNUz4YoU1tVfSCSqQYn6//11U6Nld80jEeC8aTrO+KKmCaY= -srv01.example. 3600 IN SRV 0 0 0 . -srv02.example. 3600 IN SRV 65535 65535 65535 old-slow-box.example.com. -t.example. 301 IN A 73.80.65.49 -txt01.example. 3600 IN TXT "foo" -txt02.example. 3600 IN TXT "foo" "bar" -txt03.example. 3600 IN TXT "foo" -txt04.example. 3600 IN TXT "foo" "bar" -txt05.example. 3600 IN TXT "foo bar" -txt06.example. 3600 IN TXT "foo bar" -txt07.example. 3600 IN TXT "foo bar" -txt08.example. 3600 IN TXT "foo\010bar" -txt09.example. 3600 IN TXT "foo\010bar" -txt10.example. 3600 IN TXT "foo bar" -txt11.example. 3600 IN TXT "\"foo\"" -txt12.example. 3600 IN TXT "\"foo\"" -u.example. 300 IN TXT "txt-not-in-nxt" -a.u.example. 300 IN A 73.80.65.49 -b.u.example. 300 IN A 73.80.65.49 -wks01.example. 3600 IN WKS 10.0.0.1 6 0 1 2 21 23 -wks02.example. 3600 IN WKS 10.0.0.1 17 0 1 2 53 -wks03.example. 3600 IN WKS 10.0.0.2 6 65535 -x2501.example. 3600 IN X25 "123456789" -example. 300 IN SOA ns2.example. hostmaster.example. 2000042795 20 20 1814400 3600 diff --git a/usr.sbin/bind/bin/tests/system/xfer/ns2/example.db b/usr.sbin/bind/bin/tests/system/xfer/ns2/example.db deleted file mode 100644 index fe180a771f0..00000000000 --- a/usr.sbin/bind/bin/tests/system/xfer/ns2/example.db +++ /dev/null @@ -1,159 +0,0 @@ -; Copyright (C) 2000, 2001 Internet Software Consortium. -; -; 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. -; -; THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM -; DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL -; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL -; INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, -; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING -; FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, -; NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION -; WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -; $ISC: example.db,v 1.7 2001/01/09 21:45:49 bwelling Exp $ - -$ORIGIN . -$TTL 300 ; 5 minutes -example IN SOA ns2.example. hostmaster.example. ( - 2000042795 ; serial - 20 ; refresh (20 seconds) - 20 ; retry (20 seconds) - 1814400 ; expire (3 weeks) - 3600 ; minimum (1 hour) - ) -example. NS ns2.example. -ns2.example. A 10.53.0.2 -example. NS ns3.example. -ns3.example. A 10.53.0.3 - -$ORIGIN example. -* MX 10 mail -a TXT "foo foo foo" - PTR foo.net. -$TTL 3600 ; 1 hour -a01 A 0.0.0.0 -a02 A 255.255.255.255 -a601 A6 0 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff - A6 64 ::ffff:ffff:ffff:ffff foo. - A6 127 ::1 foo. - A6 128 . -afsdb01 AFSDB 0 hostname -afsdb02 AFSDB 65535 . -$TTL 300 ; 5 minutes -b CNAME foo.net. -c A 73.80.65.49 -$TTL 3600 ; 1 hour -cert01 CERT 65534 65535 PRIVATEOID ( - MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgi - WCn/GxHhai6VAuHAoNUz4YoU1tVfSCSqQYn6//11U6Nl - d80jEeC8aTrO+KKmCaY= ) -cname01 CNAME cname-target. -cname02 CNAME cname-target -cname03 CNAME . -$TTL 300 ; 5 minutes -d A 73.80.65.49 -$TTL 3600 ; 1 hour -dname01 DNAME dname-target. -dname02 DNAME dname-target -dname03 DNAME . -$TTL 300 ; 5 minutes -e MX 10 mail - TXT "one" - TXT "three" - TXT "two" - A 73.80.65.49 - A 73.80.65.50 - A 73.80.65.52 - A 73.80.65.51 -f A 73.80.65.52 -$TTL 3600 ; 1 hour -gpos01 GPOS "-22.6882" "116.8652" "250.0" -gpos02 GPOS "" "" "" -hinfo01 HINFO "Generic PC clone" "NetBSD-1.4" -hinfo02 HINFO "PC" "NetBSD" -isdn01 ISDN "isdn-address" -isdn02 ISDN "isdn-address" "subaddress" -isdn03 ISDN "isdn-address" -isdn04 ISDN "isdn-address" "subaddress" -key01 KEY 512 255 1 ( - AQMFD5raczCJHViKtLYhWGz8hMY9UGRuniJDBzC7w0aR - yzWZriO6i2odGWWQVucZqKVsENW91IOW4vqudngPZsY3 - GvQ/xVA8/7pyFj6b7Esga60zyGW6LFe9r8n6paHrlG5o - jqf0BaqHT+8= ) -kx01 KX 10 kdc -kx02 KX 10 . -loc01 LOC 60 9 0.000 N 24 39 0.000 E 10.00m 20m 2000m 20m -loc02 LOC 60 9 0.000 N 24 39 0.000 E 10.00m 20m 2000m 20m -mb01 MG madname -mb02 MG . -md01 MD madname - MD . -mf01 MF madname - MF . -mg01 MG mgmname -mg02 MG . -minfo01 MINFO rmailbx emailbx -minfo02 MINFO . . -mr01 MR mrname -mr02 MR . -mx01 MX 10 mail -mx02 MX 10 . -naptr01 NAPTR 0 0 "" "" "" . -naptr02 NAPTR 65535 65535 "blurgh" "blorf" "blegh" foo. -nsap-ptr01 NSAP-PTR foo. - NSAP-PTR . -nsap01 NSAP 0x47000580005a0000000001e133ffffff00016100 -nsap02 NSAP 0x47000580005a0000000001e133ffffff00016100 -nxt01 NXT a.secure ( NS SOA MX SIG KEY LOC NXT ) -nxt02 NXT . ( NSAP-PTR NXT ) -nxt03 NXT . ( A ) -nxt04 NXT . ( 127 ) -ptr01 PTR example. -px01 PX 65535 foo. bar. -px02 PX 65535 . . -rp01 RP mbox-dname txt-dname -rp02 RP . . -rt01 RT 0 intermediate-host -rt02 RT 65535 . -$TTL 300 ; 5 minutes -s NS ns.s -$ORIGIN s.example. -ns A 73.80.65.49 -$ORIGIN example. -$TTL 3600 ; 1 hour -sig01 SIG NXT 1 3 3600 20000102030405 ( - 19961211100908 2143 foo - MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgi - WCn/GxHhai6VAuHAoNUz4YoU1tVfSCSqQYn6//11U6Nl - d80jEeC8aTrO+KKmCaY= ) -srv01 SRV 0 0 0 . -srv02 SRV 65535 65535 65535 old-slow-box.example.com. -$TTL 301 ; 5 minutes 1 second -t A 73.80.65.49 -$TTL 3600 ; 1 hour -txt01 TXT "foo" -txt02 TXT "foo" "bar" -txt03 TXT "foo" -txt04 TXT "foo" "bar" -txt05 TXT "foo bar" -txt06 TXT "foo bar" -txt07 TXT "foo bar" -txt08 TXT "foo\010bar" -txt09 TXT "foo\010bar" -txt10 TXT "foo bar" -txt11 TXT "\"foo\"" -txt12 TXT "\"foo\"" -$TTL 300 ; 5 minutes -u TXT "txt-not-in-nxt" -$ORIGIN u.example. -a A 73.80.65.49 -b A 73.80.65.49 -$ORIGIN example. -$TTL 3600 ; 1 hour -wks01 WKS 10.0.0.1 6 ( 0 1 2 21 23 ) -wks02 WKS 10.0.0.1 17 ( 0 1 2 53 ) -wks03 WKS 10.0.0.2 6 ( 65535 ) -x2501 X25 "123456789" diff --git a/usr.sbin/bind/bin/tests/system/xfer/ns2/tsigzone.db b/usr.sbin/bind/bin/tests/system/xfer/ns2/tsigzone.db deleted file mode 100644 index c84a64882a9..00000000000 --- a/usr.sbin/bind/bin/tests/system/xfer/ns2/tsigzone.db +++ /dev/null @@ -1,159 +0,0 @@ -; Copyright (C) 2000, 2001 Internet Software Consortium. -; -; 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. -; -; THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM -; DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL -; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL -; INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, -; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING -; FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, -; NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION -; WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -; $ISC: tsigzone.db,v 1.6 2001/01/09 21:45:53 bwelling Exp $ - -$ORIGIN . -$TTL 300 ; 5 minutes -tsigzone IN SOA ns2.tsigzone. hostmaster.tsigzone. ( - 2000042795 ; serial - 20 ; refresh (20 seconds) - 20 ; retry (20 seconds) - 1814400 ; expire (3 weeks) - 3600 ; minimum (1 hour) - ) -tsigzone. NS ns2.tsigzone. -ns2.tsigzone. A 10.53.0.2 -tsigzone. NS ns3.tsigzone. -ns3.tsigzone. A 10.53.0.3 - -$ORIGIN tsigzone. -* MX 10 mail -a TXT "foo foo foo" - PTR foo.net. -$TTL 3600 ; 1 hour -a01 A 0.0.0.0 -a02 A 255.255.255.255 -a601 A6 0 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff - A6 64 ::ffff:ffff:ffff:ffff foo. - A6 127 ::1 foo. - A6 128 . -afsdb01 AFSDB 0 hostname -afsdb02 AFSDB 65535 . -$TTL 300 ; 5 minutes -b CNAME foo.net. -c A 73.80.65.49 -$TTL 3600 ; 1 hour -cert01 CERT 65534 65535 PRIVATEOID ( - MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgi - WCn/GxHhai6VAuHAoNUz4YoU1tVfSCSqQYn6//11U6Nl - d80jEeC8aTrO+KKmCaY= ) -cname01 CNAME cname-target. -cname02 CNAME cname-target -cname03 CNAME . -$TTL 300 ; 5 minutes -d A 73.80.65.49 -$TTL 3600 ; 1 hour -dname01 DNAME dname-target. -dname02 DNAME dname-target -dname03 DNAME . -$TTL 300 ; 5 minutes -e MX 10 mail - TXT "one" - TXT "three" - TXT "two" - A 73.80.65.49 - A 73.80.65.50 - A 73.80.65.52 - A 73.80.65.51 -f A 73.80.65.52 -$TTL 3600 ; 1 hour -gpos01 GPOS "-22.6882" "116.8652" "250.0" -gpos02 GPOS "" "" "" -hinfo01 HINFO "Generic PC clone" "NetBSD-1.4" -hinfo02 HINFO "PC" "NetBSD" -isdn01 ISDN "isdn-address" -isdn02 ISDN "isdn-address" "subaddress" -isdn03 ISDN "isdn-address" -isdn04 ISDN "isdn-address" "subaddress" -key01 KEY 512 255 1 ( - AQMFD5raczCJHViKtLYhWGz8hMY9UGRuniJDBzC7w0aR - yzWZriO6i2odGWWQVucZqKVsENW91IOW4vqudngPZsY3 - GvQ/xVA8/7pyFj6b7Esga60zyGW6LFe9r8n6paHrlG5o - jqf0BaqHT+8= ) -kx01 KX 10 kdc -kx02 KX 10 . -loc01 LOC 60 9 0.000 N 24 39 0.000 E 10.00m 20m 2000m 20m -loc02 LOC 60 9 0.000 N 24 39 0.000 E 10.00m 20m 2000m 20m -mb01 MG madname -mb02 MG . -md01 MD madname - MD . -mf01 MF madname - MF . -mg01 MG mgmname -mg02 MG . -minfo01 MINFO rmailbx emailbx -minfo02 MINFO . . -mr01 MR mrname -mr02 MR . -mx01 MX 10 mail -mx02 MX 10 . -naptr01 NAPTR 0 0 "" "" "" . -naptr02 NAPTR 65535 65535 "blurgh" "blorf" "blegh" foo. -nsap-ptr01 NSAP-PTR foo. - NSAP-PTR . -nsap01 NSAP 0x47000580005a0000000001e133ffffff00016100 -nsap02 NSAP 0x47000580005a0000000001e133ffffff00016100 -nxt01 NXT a.secure ( NS SOA MX SIG KEY LOC NXT ) -nxt02 NXT . ( NSAP-PTR NXT ) -nxt03 NXT . ( A ) -nxt04 NXT . ( 127 ) -ptr01 PTR tsigzone. -px01 PX 65535 foo. bar. -px02 PX 65535 . . -rp01 RP mbox-dname txt-dname -rp02 RP . . -rt01 RT 0 intermediate-host -rt02 RT 65535 . -$TTL 300 ; 5 minutes -s NS ns.s -$ORIGIN s.tsigzone. -ns A 73.80.65.49 -$ORIGIN tsigzone. -$TTL 3600 ; 1 hour -sig01 SIG NXT 1 3 3600 20000102030405 ( - 19961211100908 2143 foo - MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgi - WCn/GxHhai6VAuHAoNUz4YoU1tVfSCSqQYn6//11U6Nl - d80jEeC8aTrO+KKmCaY= ) -srv01 SRV 0 0 0 . -srv02 SRV 65535 65535 65535 old-slow-box.tsigzone.com. -$TTL 301 ; 5 minutes 1 second -t A 73.80.65.49 -$TTL 3600 ; 1 hour -txt01 TXT "foo" -txt02 TXT "foo" "bar" -txt03 TXT "foo" -txt04 TXT "foo" "bar" -txt05 TXT "foo bar" -txt06 TXT "foo bar" -txt07 TXT "foo bar" -txt08 TXT "foo\010bar" -txt09 TXT "foo\010bar" -txt10 TXT "foo bar" -txt11 TXT "\"foo\"" -txt12 TXT "\"foo\"" -$TTL 300 ; 5 minutes -u TXT "txt-not-in-nxt" -$ORIGIN u.tsigzone. -a A 73.80.65.49 -b A 73.80.65.49 -$ORIGIN tsigzone. -$TTL 3600 ; 1 hour -wks01 WKS 10.0.0.1 6 ( 0 1 2 21 23 ) -wks02 WKS 10.0.0.1 17 ( 0 1 2 53 ) -wks03 WKS 10.0.0.2 6 ( 65535 ) -x2501 X25 "123456789" diff --git a/usr.sbin/bind/lib/dns/a6.c b/usr.sbin/bind/lib/dns/a6.c deleted file mode 100644 index c946ee5dfa8..00000000000 --- a/usr.sbin/bind/lib/dns/a6.c +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * 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. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM - * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL - * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION - * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* $ISC: a6.c,v 1.20 2001/06/04 19:32:54 tale Exp $ */ - -#include <config.h> - -#include <isc/util.h> - -#include <dns/a6.h> -#include <dns/name.h> -#include <dns/rdata.h> -#include <dns/rdataset.h> - -#define A6CONTEXT_MAGIC ISC_MAGIC('A', '6', 'X', 'X') -#define VALID_A6CONTEXT(ac) ISC_MAGIC_VALID(ac, A6CONTEXT_MAGIC) - -#define MAX_CHAINS 8 -#define MAX_DEPTH 16 - -static inline void -maybe_disassociate(dns_rdataset_t *rdataset) { - if (dns_rdataset_isassociated(rdataset)) - dns_rdataset_disassociate(rdataset); -} - -static isc_result_t -foreach(dns_a6context_t *a6ctx, dns_rdataset_t *parent, unsigned int depth, - unsigned int oprefixlen) -{ - dns_rdata_t rdata = DNS_RDATA_INIT; - isc_region_t r; - dns_name_t name; - dns_rdataset_t child; - dns_rdataset_t childsig; - isc_result_t result; - isc_uint8_t prefixlen, octets; - isc_bitstring_t bitstring; - isc_stdtime_t expiration; - - expiration = a6ctx->now + parent->ttl; - if (expiration < a6ctx->expiration || a6ctx->expiration == 0) - a6ctx->expiration = expiration; - - depth++; - result = dns_rdataset_first(parent); - while (result == ISC_R_SUCCESS) { - dns_rdataset_current(parent, &rdata); - dns_rdata_toregion(&rdata, &r); - prefixlen = r.base[0]; - if (prefixlen > oprefixlen) { - /* - * Trying to go to a longer prefix is illegal. - */ - goto next_a6; - } - if (prefixlen < 128) { - isc_bitstring_init(&bitstring, &r.base[1], - 128 - prefixlen, 128 - prefixlen, - ISC_TRUE); - isc_bitstring_copy(&bitstring, 128 - oprefixlen, - &a6ctx->bitstring, 128 - oprefixlen, - oprefixlen - prefixlen); - } - octets = 16 - prefixlen / 8; - if (prefixlen != 0) { - if (depth < MAX_DEPTH) { - isc_region_consume(&r, octets + 1); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r); - dns_rdataset_init(&child); - dns_rdataset_init(&childsig); - result = (a6ctx->find)(a6ctx->arg, &name, - dns_rdatatype_a6, - a6ctx->now, - &child, &childsig); - if (result == ISC_R_SUCCESS) { - /* - * We've found a new A6 rrset. - */ - if (a6ctx->rrset != NULL) - (a6ctx->rrset)(a6ctx->arg, - &name, - &child, - &childsig); - /* - * Keep following the chain. - */ - result = foreach(a6ctx, &child, depth, - prefixlen); - dns_rdataset_disassociate(&child); - maybe_disassociate(&childsig); - if (result != ISC_R_SUCCESS) - break; - } else if (result == ISC_R_NOTFOUND && - a6ctx->missing != NULL) { - /* - * We can't follow this chain, because - * we don't know the next link. - * - * We update the 'depth' and - * 'prefixlen' values so that the - * missing function can make a copy - * of the a6context and resume - * processing after it has found the - * missing a6 context. - */ - a6ctx->depth = depth; - a6ctx->prefixlen = prefixlen; - (a6ctx->missing)(a6ctx, &name); - } else { - /* - * Either something went wrong, or - * we got a negative cache response. - * In either case, we can't follow - * this chain further, and we don't - * want to call the 'missing' - * function. - * - * Note that we currently require that - * the target of an A6 record is - * a canonical domain name. If the - * find routine returns DNS_R_CNAME or - * DNS_R_DNAME, we do NOT follow the - * chain. - * - * We do want to clean up... - */ - maybe_disassociate(&child); - maybe_disassociate(&childsig); - } - } - } else { - /* - * We have a complete chain. - */ - if (a6ctx->address != NULL) - (a6ctx->address)(a6ctx); - } - next_a6: - dns_rdata_reset(&rdata); - result = dns_rdataset_next(parent); - if (result == ISC_R_SUCCESS) { - a6ctx->chains++; - if (a6ctx->chains > MAX_CHAINS) - return (ISC_R_QUOTA); - } - } - if (result != ISC_R_NOMORE) - return (result); - return (ISC_R_SUCCESS); -} - -void -dns_a6_init(dns_a6context_t *a6ctx, dns_findfunc_t find, dns_rrsetfunc_t rrset, - dns_in6addrfunc_t address, dns_a6missingfunc_t missing, void *arg) -{ - REQUIRE(a6ctx != NULL); - REQUIRE(find != NULL); - - a6ctx->magic = A6CONTEXT_MAGIC; - a6ctx->find = find; - a6ctx->rrset = rrset; - a6ctx->missing = missing; - a6ctx->address = address; - a6ctx->arg = arg; - a6ctx->chains = 1; - a6ctx->depth = 0; - a6ctx->now = 0; - a6ctx->expiration = 0; - a6ctx->prefixlen = 128; - isc_bitstring_init(&a6ctx->bitstring, - (unsigned char *)a6ctx->in6addr.s6_addr, - 128, 128, ISC_TRUE); -} - -void -dns_a6_reset(dns_a6context_t *a6ctx) { - REQUIRE(VALID_A6CONTEXT(a6ctx)); - - a6ctx->chains = 1; - a6ctx->depth = 0; - a6ctx->expiration = 0; - a6ctx->prefixlen = 128; -} - -void -dns_a6_invalidate(dns_a6context_t *a6ctx) { - REQUIRE(VALID_A6CONTEXT(a6ctx)); - - a6ctx->magic = 0; -} - -void -dns_a6_copy(dns_a6context_t *source, dns_a6context_t *target) { - REQUIRE(VALID_A6CONTEXT(source)); - REQUIRE(VALID_A6CONTEXT(target)); - - *target = *source; - isc_bitstring_init(&target->bitstring, - (unsigned char *)target->in6addr.s6_addr, - 128, 128, ISC_TRUE); -} - -isc_result_t -dns_a6_foreach(dns_a6context_t *a6ctx, dns_rdataset_t *rdataset, - isc_stdtime_t now) -{ - isc_result_t result; - - REQUIRE(VALID_A6CONTEXT(a6ctx)); - REQUIRE(rdataset->type == dns_rdatatype_a6); - - if (now == 0) - isc_stdtime_get(&now); - a6ctx->now = now; - - result = foreach(a6ctx, rdataset, a6ctx->depth, a6ctx->prefixlen); - if (result == ISC_R_QUOTA) - result = ISC_R_SUCCESS; - - return (result); -} diff --git a/usr.sbin/bind/lib/dns/include/dns/a6.h b/usr.sbin/bind/lib/dns/include/dns/a6.h deleted file mode 100644 index c360cfff88c..00000000000 --- a/usr.sbin/bind/lib/dns/include/dns/a6.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * 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. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM - * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL - * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION - * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* $ISC: a6.h,v 1.11 2001/01/09 21:52:14 bwelling Exp $ */ - -#ifndef DNS_A6_H -#define DNS_A6_H 1 - -#include <isc/lang.h> -#include <isc/stdtime.h> -#include <isc/bitstring.h> -#include <isc/net.h> - -#include <dns/types.h> - -typedef isc_result_t (*dns_findfunc_t)(void *arg, dns_name_t *name, - dns_rdatatype_t type, - isc_stdtime_t now, - dns_rdataset_t *rdataset, - dns_rdataset_t *sigrdataset); - -typedef void (*dns_rrsetfunc_t)(void *arg, dns_name_t *name, - dns_rdataset_t *rdataset, - dns_rdataset_t *sigrdataset); - -typedef void (*dns_in6addrfunc_t)(dns_a6context_t *a6ctx); - -typedef void (*dns_a6missingfunc_t)(dns_a6context_t *a6ctx, dns_name_t *name); - -struct dns_a6context { - unsigned int magic; - /* Public. */ - dns_findfunc_t find; - dns_rrsetfunc_t rrset; - dns_in6addrfunc_t address; - dns_a6missingfunc_t missing; - void * arg; - unsigned int chains; - unsigned int depth; - isc_stdtime_t now; - isc_stdtime_t expiration; - unsigned int prefixlen; - struct in6_addr in6addr; - isc_bitstring_t bitstring; -}; - -ISC_LANG_BEGINDECLS - -void -dns_a6_init(dns_a6context_t *a6ctx, dns_findfunc_t find, dns_rrsetfunc_t rrset, - dns_in6addrfunc_t address, dns_a6missingfunc_t missing, void *arg); - -void -dns_a6_reset(dns_a6context_t *a6ctx); - -void -dns_a6_invalidate(dns_a6context_t *a6ctx); - -void -dns_a6_copy(dns_a6context_t *source, dns_a6context_t *target); - -isc_result_t -dns_a6_foreach(dns_a6context_t *a6ctx, dns_rdataset_t *rdataset, - isc_stdtime_t now); - -ISC_LANG_ENDDECLS - -#endif /* DNS_A6_H */ diff --git a/usr.sbin/bind/lib/dns/include/dns/nxt.h b/usr.sbin/bind/lib/dns/include/dns/nxt.h deleted file mode 100644 index ebce8121895..00000000000 --- a/usr.sbin/bind/lib/dns/include/dns/nxt.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * 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. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM - * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL - * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION - * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* $ISC: nxt.h,v 1.12 2001/01/09 21:53:08 bwelling Exp $ */ - -#ifndef DNS_NXT_H -#define DNS_NXT_H 1 - -#include <isc/lang.h> - -#include <dns/types.h> - -#define DNS_NXT_BUFFERSIZE (256 + 16) - -ISC_LANG_BEGINDECLS - -isc_result_t -dns_nxt_buildrdata(dns_db_t *db, dns_dbversion_t *version, - dns_dbnode_t *node, dns_name_t *target, - unsigned char *buffer, dns_rdata_t *rdata); -/* - * Build the rdata of a NXT record. - * - * Requires: - * buffer Points to a temporary buffer of at least - * DNS_NXT_BUFFERSIZE bytes. - * rdata Points to an initialized dns_rdata_t. - * - * Ensures: - * *rdata Contains a valid NXT rdata. The 'data' member refers - * to 'buffer'. - */ - -isc_result_t -dns_nxt_build(dns_db_t *db, dns_dbversion_t *version, dns_dbnode_t *node, - dns_name_t *target, dns_ttl_t ttl); -/* - * Build a NXT record and add it to a database. - */ - -isc_boolean_t -dns_nxt_typepresent(dns_rdata_t *nxt, dns_rdatatype_t type); -/* - * Determine if a type is marked as present in an NXT record. - * - * Requires: - * 'nxt' points to a valid rdataset of type NXT - * 'type' < 128 - * - */ - -ISC_LANG_ENDDECLS - -#endif /* DNS_NXT_H */ diff --git a/usr.sbin/bind/lib/dns/nxt.c b/usr.sbin/bind/lib/dns/nxt.c deleted file mode 100644 index 00c67f291cd..00000000000 --- a/usr.sbin/bind/lib/dns/nxt.c +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright (C) 1999-2001, 2003 Internet Software Consortium. - * - * 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. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM - * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL - * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION - * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* $ISC: nxt.c,v 1.26.2.2 2003/10/09 07:32:37 marka Exp $ */ - -#include <config.h> - -#include <isc/string.h> -#include <isc/util.h> - -#include <dns/db.h> -#include <dns/nxt.h> -#include <dns/rdata.h> -#include <dns/rdatalist.h> -#include <dns/rdataset.h> -#include <dns/rdatasetiter.h> -#include <dns/rdatastruct.h> -#include <dns/result.h> - -#define RETERR(x) do { \ - result = (x); \ - if (result != ISC_R_SUCCESS) \ - goto failure; \ - } while (0) - -static void -set_bit(unsigned char *array, unsigned int index, unsigned int bit) { - unsigned int shift, mask; - - shift = 7 - (index % 8); - mask = 1 << shift; - - if (bit != 0) - array[index / 8] |= mask; - else - array[index / 8] &= (~mask & 0xFF); -} - -static unsigned int -bit_isset(unsigned char *array, unsigned int index) { - unsigned int byte, shift, mask; - - byte = array[index / 8]; - shift = 7 - (index % 8); - mask = 1 << shift; - - return ((byte & mask) != 0); -} - -isc_result_t -dns_nxt_buildrdata(dns_db_t *db, dns_dbversion_t *version, - dns_dbnode_t *node, dns_name_t *target, - unsigned char *buffer, dns_rdata_t *rdata) -{ - isc_result_t result; - dns_rdataset_t rdataset; - isc_region_t r; - int i; - - unsigned char *nxt_bits; - unsigned int max_type; - dns_rdatasetiter_t *rdsiter; - - memset(buffer, 0, DNS_NXT_BUFFERSIZE); - dns_name_toregion(target, &r); - memcpy(buffer, r.base, r.length); - r.base = buffer; - nxt_bits = r.base + r.length; - set_bit(nxt_bits, dns_rdatatype_nxt, 1); - max_type = dns_rdatatype_nxt; - dns_rdataset_init(&rdataset); - rdsiter = NULL; - result = dns_db_allrdatasets(db, node, version, 0, &rdsiter); - if (result != ISC_R_SUCCESS) - return (result); - for (result = dns_rdatasetiter_first(rdsiter); - result == ISC_R_SUCCESS; - result = dns_rdatasetiter_next(rdsiter)) - { - dns_rdatasetiter_current(rdsiter, &rdataset); - if (rdataset.type > 127) - /* XXX "rdataset type too large" */ - return (ISC_R_RANGE); - if (rdataset.type != dns_rdatatype_nxt) { - if (rdataset.type > max_type) - max_type = rdataset.type; - set_bit(nxt_bits, rdataset.type, 1); - } - dns_rdataset_disassociate(&rdataset); - } - - /* - * At zone cuts, deny the existence of glue in the parent zone. - */ - if (bit_isset(nxt_bits, dns_rdatatype_ns) && - ! bit_isset(nxt_bits, dns_rdatatype_soa)) { - for (i = 0; i < 128; i++) { - if (bit_isset(nxt_bits, i) && - ! dns_rdatatype_iszonecutauth((dns_rdatatype_t)i)) - set_bit(nxt_bits, i, 0); - } - } - - dns_rdatasetiter_destroy(&rdsiter); - if (result != ISC_R_NOMORE) - return (result); - - r.length += max_type / 8 + 1; - INSIST(r.length <= DNS_NXT_BUFFERSIZE); - dns_rdata_fromregion(rdata, - dns_db_class(db), - dns_rdatatype_nxt, - &r); - - return (ISC_R_SUCCESS); -} - - -isc_result_t -dns_nxt_build(dns_db_t *db, dns_dbversion_t *version, dns_dbnode_t *node, - dns_name_t *target, dns_ttl_t ttl) -{ - isc_result_t result; - dns_rdata_t rdata = DNS_RDATA_INIT; - unsigned char data[DNS_NXT_BUFFERSIZE]; - dns_rdatalist_t rdatalist; - dns_rdataset_t rdataset; - - dns_rdataset_init(&rdataset); - dns_rdata_init(&rdata); - - RETERR(dns_nxt_buildrdata(db, version, node, target, data, &rdata)); - - rdatalist.rdclass = dns_db_class(db); - rdatalist.type = dns_rdatatype_nxt; - rdatalist.covers = 0; - rdatalist.ttl = ttl; - ISC_LIST_INIT(rdatalist.rdata); - ISC_LIST_APPEND(rdatalist.rdata, &rdata, link); - RETERR(dns_rdatalist_tordataset(&rdatalist, &rdataset)); - result = dns_db_addrdataset(db, node, version, 0, &rdataset, - 0, NULL); - if (result == DNS_R_UNCHANGED) - result = ISC_R_SUCCESS; - RETERR(result); - failure: - if (dns_rdataset_isassociated(&rdataset)) - dns_rdataset_disassociate(&rdataset); - return (result); -} - -isc_boolean_t -dns_nxt_typepresent(dns_rdata_t *nxt, dns_rdatatype_t type) { - dns_rdata_nxt_t nxtstruct; - isc_result_t result; - isc_boolean_t present; - - REQUIRE(nxt != NULL); - REQUIRE(nxt->type == dns_rdatatype_nxt); - REQUIRE(type < 128); - - /* This should never fail */ - result = dns_rdata_tostruct(nxt, &nxtstruct, NULL); - INSIST(result == ISC_R_SUCCESS); - - if (type >= nxtstruct.len * 8) - present = ISC_FALSE; - else - present = ISC_TF(bit_isset(nxtstruct.typebits, type)); - dns_rdata_freestruct(&nxt); - return (present); -} diff --git a/usr.sbin/bind/lib/isccfg/check.c b/usr.sbin/bind/lib/isccfg/check.c deleted file mode 100644 index 6c035b9cda0..00000000000 --- a/usr.sbin/bind/lib/isccfg/check.c +++ /dev/null @@ -1,691 +0,0 @@ -/* - * Copyright (C) 2001-2003 Internet Software Consortium. - * - * 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. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM - * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL - * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION - * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* $ISC: check.c,v 1.14.2.21 2003/09/19 13:41:36 marka Exp $ */ - -#include <config.h> - -#include <stdlib.h> -#include <string.h> - -#include <isc/buffer.h> -#include <isc/log.h> -#include <isc/mem.h> -#include <isc/netaddr.h> -#include <isc/result.h> -#include <isc/sockaddr.h> -#include <isc/symtab.h> -#include <isc/util.h> - -#include <dns/fixedname.h> - -#include <isccfg/cfg.h> -#include <isccfg/check.h> - -static isc_result_t -check_forward(cfg_obj_t *options, isc_log_t *logctx) { - cfg_obj_t *forward = NULL; - cfg_obj_t *forwarders = NULL; - - (void)cfg_map_get(options, "forward", &forward); - (void)cfg_map_get(options, "forwarders", &forwarders); - - if (forward != NULL && forwarders == NULL) { - cfg_obj_log(forward, logctx, ISC_LOG_ERROR, - "no matching 'forwarders' statement"); - return (ISC_R_FAILURE); - } - return (ISC_R_SUCCESS); -} - -typedef struct { - const char *name; - unsigned int scale; -} intervaltable; - -static isc_result_t -check_options(cfg_obj_t *options, isc_log_t *logctx) { - isc_result_t result = ISC_R_SUCCESS; - unsigned int i; - cfg_obj_t *obj; - - static intervaltable intervals[] = { - { "cleaning-interval", 60 }, - { "heartbeat-interval", 60 }, - { "interface-interval", 60 }, - { "max-transfer-idle-in", 60 }, - { "max-transfer-idle-out", 60 }, - { "max-transfer-time-in", 60 }, - { "max-transfer-time-out", 60 }, - { "sig-validity-interval", 86400}, - { "statistics-interval", 60 }, - }; - - /* - * Check that fields specified in units of time other than seconds - * have reasonable values. - */ - for (i = 0; i < sizeof(intervals) / sizeof(intervals[0]); i++) { - isc_uint32_t val; - cfg_obj_t *obj = NULL; - (void)cfg_map_get(options, intervals[i].name, &obj); - if (obj == NULL) - continue; - val = cfg_obj_asuint32(obj); - if (val > (ISC_UINT32_MAX / intervals[i].scale)) { - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "%s '%d' is out of range", - intervals[i].name, val); - result = ISC_R_RANGE; - } - } - - obj = NULL; - (void)cfg_map_get(options, "root-delegation-only", &obj); - if (obj != NULL) { - if (!cfg_obj_isvoid(obj)) { - cfg_listelt_t *element; - cfg_obj_t *exclude; - char *str; - dns_fixedname_t fixed; - dns_name_t *name; - isc_buffer_t b; - isc_result_t tresult; - - dns_fixedname_init(&fixed); - name = dns_fixedname_name(&fixed); - for (element = cfg_list_first(obj); - element != NULL; - element = cfg_list_next(element)) { - exclude = cfg_listelt_value(element); - str = cfg_obj_asstring(exclude); - isc_buffer_init(&b, str, strlen(str)); - isc_buffer_add(&b, strlen(str)); - tresult = dns_name_fromtext(name, &b, - dns_rootname, - ISC_FALSE, NULL); - if (tresult != ISC_R_SUCCESS) { - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "bad domain name '%s'", - str); - result = tresult; - } - } - } - } - return (result); -} - -#define MASTERZONE 1 -#define SLAVEZONE 2 -#define STUBZONE 4 -#define HINTZONE 8 -#define FORWARDZONE 16 -#define DELEGATIONZONE 32 - -typedef struct { - const char *name; - int allowed; -} optionstable; - -static isc_result_t -check_zoneconf(cfg_obj_t *zconfig, isc_symtab_t *symtab, isc_log_t *logctx, - isc_mem_t *mctx) -{ - const char *zname; - const char *typestr; - unsigned int ztype; - cfg_obj_t *zoptions; - cfg_obj_t *obj = NULL; - cfg_obj_t *addrlist = NULL; - isc_symvalue_t symvalue; - isc_result_t result = ISC_R_SUCCESS; - isc_result_t tresult; - unsigned int i; - dns_fixedname_t fixedname; - isc_buffer_t b; - - static optionstable options[] = { - { "allow-query", MASTERZONE | SLAVEZONE | STUBZONE }, - { "allow-notify", SLAVEZONE }, - { "allow-transfer", MASTERZONE | SLAVEZONE }, - { "notify", MASTERZONE | SLAVEZONE }, - { "also-notify", MASTERZONE | SLAVEZONE }, - { "dialup", MASTERZONE | SLAVEZONE | STUBZONE }, - { "delegation-only", HINTZONE | STUBZONE }, - { "forward", MASTERZONE | SLAVEZONE | STUBZONE | FORWARDZONE}, - { "forwarders", MASTERZONE | SLAVEZONE | STUBZONE | FORWARDZONE}, - { "maintain-ixfr-base", MASTERZONE | SLAVEZONE }, - { "max-ixfr-log-size", MASTERZONE | SLAVEZONE }, - { "notify-source", MASTERZONE | SLAVEZONE }, - { "notify-source-v6", MASTERZONE | SLAVEZONE }, - { "transfer-source", SLAVEZONE | STUBZONE }, - { "transfer-source-v6", SLAVEZONE | STUBZONE }, - { "max-transfer-time-in", SLAVEZONE | STUBZONE }, - { "max-transfer-time-out", MASTERZONE | SLAVEZONE }, - { "max-transfer-idle-in", SLAVEZONE | STUBZONE }, - { "max-transfer-idle-out", MASTERZONE | SLAVEZONE }, - { "max-retry-time", SLAVEZONE | STUBZONE }, - { "min-retry-time", SLAVEZONE | STUBZONE }, - { "max-refresh-time", SLAVEZONE | STUBZONE }, - { "min-refresh-time", SLAVEZONE | STUBZONE }, - { "sig-validity-interval", MASTERZONE }, - { "zone-statistics", MASTERZONE | SLAVEZONE | STUBZONE }, - { "allow-update", MASTERZONE }, - { "allow-update-forwarding", SLAVEZONE }, - { "file", MASTERZONE | SLAVEZONE | STUBZONE | HINTZONE}, - { "ixfr-base", MASTERZONE | SLAVEZONE }, - { "ixfr-tmp-file", MASTERZONE | SLAVEZONE }, - { "masters", SLAVEZONE | STUBZONE }, - { "pubkey", MASTERZONE | SLAVEZONE | STUBZONE }, - { "update-policy", MASTERZONE }, - { "database", MASTERZONE | SLAVEZONE | STUBZONE }, - }; - - static optionstable dialups[] = { - { "notify", MASTERZONE | SLAVEZONE }, - { "notify-passive", SLAVEZONE }, - { "refresh", SLAVEZONE | STUBZONE }, - { "passive", SLAVEZONE | STUBZONE }, - }; - - zname = cfg_obj_asstring(cfg_tuple_get(zconfig, "name")); - - zoptions = cfg_tuple_get(zconfig, "options"); - - obj = NULL; - (void)cfg_map_get(zoptions, "type", &obj); - if (obj == NULL) { - cfg_obj_log(zconfig, logctx, ISC_LOG_ERROR, - "zone '%s': type not present", zname); - return (ISC_R_FAILURE); - } - - typestr = cfg_obj_asstring(obj); - if (strcasecmp(typestr, "master") == 0) - ztype = MASTERZONE; - else if (strcasecmp(typestr, "slave") == 0) - ztype = SLAVEZONE; - else if (strcasecmp(typestr, "stub") == 0) - ztype = STUBZONE; - else if (strcasecmp(typestr, "forward") == 0) - ztype = FORWARDZONE; - else if (strcasecmp(typestr, "hint") == 0) - ztype = HINTZONE; - else if (strcasecmp(typestr, "delegation-only") == 0) - ztype = DELEGATIONZONE; - else { - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "zone '%s': invalid type %s", - zname, typestr); - return (ISC_R_FAILURE); - } - - /* - * Look for an already existing zone. - * We need to make this cannonical as isc_symtab_define() - * deals with strings. - */ - dns_fixedname_init(&fixedname); - isc_buffer_init(&b, zname, strlen(zname)); - isc_buffer_add(&b, strlen(zname)); - result = dns_name_fromtext(dns_fixedname_name(&fixedname), &b, - dns_rootname, ISC_TRUE, NULL); - if (result != ISC_R_SUCCESS) { - cfg_obj_log(zconfig, logctx, ISC_LOG_ERROR, - "zone '%s': is not a valid name", zname); - result = ISC_R_FAILURE; - } else { - char namebuf[DNS_NAME_FORMATSIZE]; - char *key; - - dns_name_format(dns_fixedname_name(&fixedname), - namebuf, sizeof(namebuf)); - key = isc_mem_strdup(mctx, namebuf); - if (key == NULL) - return (ISC_R_NOMEMORY); - symvalue.as_pointer = NULL; - tresult = isc_symtab_define(symtab, key, - ztype == HINTZONE ? 1 : 2, - symvalue, isc_symexists_reject); - if (tresult == ISC_R_EXISTS) { - isc_mem_free(mctx, key); - cfg_obj_log(zconfig, logctx, ISC_LOG_ERROR, - "zone '%s': already exists ", zname); - result = ISC_R_FAILURE; - } else if (tresult != ISC_R_SUCCESS) { - isc_mem_strdup(mctx, key); - return (tresult); - } - } - - /* - * Look for inappropriate options for the given zone type. - */ - for (i = 0; i < sizeof(options) / sizeof(options[0]); i++) { - obj = NULL; - if ((options[i].allowed & ztype) == 0 && - cfg_map_get(zoptions, options[i].name, &obj) == - ISC_R_SUCCESS) - { - if (strcmp(options[i].name, "allow-update") != 0 || - ztype != SLAVEZONE) { - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "option '%s' is not allowed " - "in '%s' zone '%s'", - options[i].name, typestr, zname); - result = ISC_R_FAILURE; - } else - cfg_obj_log(obj, logctx, ISC_LOG_WARNING, - "option '%s' is not allowed " - "in '%s' zone '%s'", - options[i].name, typestr, zname); - } - } - - /* - * Slave & stub zones must have a "masters" field. - */ - if (ztype == SLAVEZONE || ztype == STUBZONE) { - obj = NULL; - if (cfg_map_get(zoptions, "masters", &obj) != ISC_R_SUCCESS) { - cfg_obj_log(zoptions, logctx, ISC_LOG_ERROR, - "zone '%s': missing 'masters' entry", - zname); - result = ISC_R_FAILURE; - } else { - addrlist = cfg_tuple_get(obj, "addresses"); - if (cfg_list_first(addrlist) == NULL) { - cfg_obj_log(zoptions, logctx, ISC_LOG_ERROR, - "zone '%s': empty 'masters' entry", - zname); - result = ISC_R_FAILURE; - } - } - } - - /* - * Master zones can't have both "allow-update" and "update-policy". - */ - if (ztype == MASTERZONE) { - isc_result_t res1, res2; - obj = NULL; - res1 = cfg_map_get(zoptions, "allow-update", &obj); - obj = NULL; - res2 = cfg_map_get(zoptions, "update-policy", &obj); - if (res1 == ISC_R_SUCCESS && res2 == ISC_R_SUCCESS) { - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "zone '%s': 'allow-update' is ignored " - "when 'update-policy' is present", - zname); - result = ISC_R_FAILURE; - } - } - - /* - * Check the excessively complicated "dialup" option. - */ - if (ztype == MASTERZONE || ztype == SLAVEZONE || ztype == STUBZONE) { - cfg_obj_t *dialup = NULL; - cfg_map_get(zoptions, "dialup", &dialup); - if (dialup != NULL && cfg_obj_isstring(dialup)) { - char *str = cfg_obj_asstring(dialup); - for (i = 0; - i < sizeof(dialups) / sizeof(dialups[0]); - i++) - { - if (strcasecmp(dialups[i].name, str) != 0) - continue; - if ((dialups[i].allowed & ztype) == 0) { - cfg_obj_log(obj, logctx, - ISC_LOG_ERROR, - "dialup type '%s' is not " - "allowed in '%s' " - "zone '%s'", - str, typestr, zname); - result = ISC_R_FAILURE; - } - break; - } - if (i == sizeof(dialups) / sizeof(dialups[0])) { - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "invalid dialup type '%s' in zone " - "'%s'", str, zname); - result = ISC_R_FAILURE; - } - } - } - - /* - * Check that forwarding is reasonable. - */ - if (check_forward(zoptions, logctx) != ISC_R_SUCCESS) - result = ISC_R_FAILURE; - - /* - * Check various options. - */ - tresult = check_options(zoptions, logctx); - if (tresult != ISC_R_SUCCESS) - result = tresult; - - return (result); -} - -isc_result_t -cfg_check_key(cfg_obj_t *key, isc_log_t *logctx) { - cfg_obj_t *algobj = NULL; - cfg_obj_t *secretobj = NULL; - const char *keyname = cfg_obj_asstring(cfg_map_getname(key)); - - cfg_map_get(key, "algorithm", &algobj); - cfg_map_get(key, "secret", &secretobj); - if (secretobj == NULL || algobj == NULL) { - cfg_obj_log(key, logctx, ISC_LOG_ERROR, - "key '%s' must have both 'secret' and " - "'algorithm' defined", - keyname); - return ISC_R_FAILURE; - } - return ISC_R_SUCCESS; -} - -static isc_result_t -check_keylist(cfg_obj_t *keys, isc_symtab_t *symtab, isc_log_t *logctx) { - isc_result_t result = ISC_R_SUCCESS; - isc_result_t tresult; - cfg_listelt_t *element; - - for (element = cfg_list_first(keys); - element != NULL; - element = cfg_list_next(element)) - { - cfg_obj_t *key = cfg_listelt_value(element); - const char *keyname = cfg_obj_asstring(cfg_map_getname(key)); - isc_symvalue_t symvalue; - - symvalue.as_pointer = NULL; - tresult = isc_symtab_define(symtab, keyname, 1, - symvalue, isc_symexists_reject); - if (tresult == ISC_R_EXISTS) { - cfg_obj_log(key, logctx, ISC_LOG_ERROR, - "key '%s': already exists ", keyname); - result = tresult; - } else if (tresult != ISC_R_SUCCESS) - return (tresult); - - tresult = cfg_check_key(key, logctx); - if (tresult != ISC_R_SUCCESS) - return (tresult); - } - return (result); -} - -static void -freekey(char *key, unsigned int type, isc_symvalue_t value, void *userarg) { - UNUSED(type); - UNUSED(value); - isc_mem_free(userarg, key); -} - -static isc_result_t -check_servers(cfg_obj_t *servers, isc_log_t *logctx) { - isc_result_t result = ISC_R_SUCCESS; - cfg_listelt_t *e1, *e2; - cfg_obj_t *v1, *v2; - isc_sockaddr_t *s1, *s2; - isc_netaddr_t na; - - for (e1 = cfg_list_first(servers); e1 != NULL; e1 = cfg_list_next(e1)) { - v1 = cfg_listelt_value(e1); - s1 = cfg_obj_assockaddr(cfg_map_getname(v1)); - e2 = e1; - while ((e2 = cfg_list_next(e2)) != NULL) { - v2 = cfg_listelt_value(e2); - s2 = cfg_obj_assockaddr(cfg_map_getname(v2)); - if (isc_sockaddr_eqaddr(s1, s2)) { - isc_buffer_t target; - char buf[128]; - - isc_netaddr_fromsockaddr(&na, s2); - isc_buffer_init(&target, buf, sizeof(buf) - 1); - INSIST(isc_netaddr_totext(&na, &target) - == ISC_R_SUCCESS); - buf[isc_buffer_usedlength(&target)] = '\0'; - - cfg_obj_log(v2, logctx, ISC_LOG_ERROR, - "server '%s': already exists", - buf); - result = ISC_R_FAILURE; - } - } - } - return (result); -} - -static isc_result_t -check_viewconf(cfg_obj_t *config, cfg_obj_t *vconfig, isc_log_t *logctx, isc_mem_t *mctx) -{ - cfg_obj_t *servers = NULL; - cfg_obj_t *zones = NULL; - cfg_obj_t *keys = NULL; - cfg_listelt_t *element; - isc_symtab_t *symtab = NULL; - isc_result_t result = ISC_R_SUCCESS; - isc_result_t tresult = ISC_R_SUCCESS; - - /* - * Check that all zone statements are syntactically correct and - * there are no duplicate zones. - */ - tresult = isc_symtab_create(mctx, 100, freekey, mctx, - ISC_TRUE, &symtab); - if (tresult != ISC_R_SUCCESS) - return (ISC_R_NOMEMORY); - - if (vconfig != NULL) - (void)cfg_map_get(vconfig, "zone", &zones); - else - (void)cfg_map_get(config, "zone", &zones); - - for (element = cfg_list_first(zones); - element != NULL; - element = cfg_list_next(element)) - { - cfg_obj_t *zone = cfg_listelt_value(element); - - if (check_zoneconf(zone, symtab, logctx, mctx) != ISC_R_SUCCESS) - result = ISC_R_FAILURE; - } - - isc_symtab_destroy(&symtab); - - /* - * Check that all key statements are syntactically correct and - * there are no duplicate keys. - */ - tresult = isc_symtab_create(mctx, 100, NULL, NULL, ISC_TRUE, &symtab); - if (tresult != ISC_R_SUCCESS) - return (ISC_R_NOMEMORY); - - cfg_map_get(config, "key", &keys); - tresult = check_keylist(keys, symtab, logctx); - if (tresult == ISC_R_EXISTS) - result = ISC_R_FAILURE; - else if (tresult != ISC_R_SUCCESS) { - isc_symtab_destroy(&symtab); - return (tresult); - } - - if (vconfig != NULL) { - keys = NULL; - (void)cfg_map_get(vconfig, "key", &keys); - tresult = check_keylist(keys, symtab, logctx); - if (tresult == ISC_R_EXISTS) - result = ISC_R_FAILURE; - else if (tresult != ISC_R_SUCCESS) { - isc_symtab_destroy(&symtab); - return (tresult); - } - } - - isc_symtab_destroy(&symtab); - - /* - * Check that forwarding is reasonable. - */ - if (vconfig == NULL) { - cfg_obj_t *options = NULL; - cfg_map_get(config, "options", &options); - if (options != NULL) - if (check_forward(options, logctx) != ISC_R_SUCCESS) - result = ISC_R_FAILURE; - } else { - if (check_forward(vconfig, logctx) != ISC_R_SUCCESS) - result = ISC_R_FAILURE; - } - - - if (vconfig != NULL) { - (void)cfg_map_get(vconfig, "server", &servers); - if (servers != NULL && - check_servers(servers, logctx) != ISC_R_SUCCESS) - result = ISC_R_FAILURE; - } - - if (vconfig != NULL) - tresult = check_options(vconfig, logctx); - else - tresult = check_options(config, logctx); - if (tresult != ISC_R_SUCCESS) - result = tresult; - - return (result); -} - - -isc_result_t -cfg_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) { - cfg_obj_t *options = NULL; - cfg_obj_t *servers = NULL; - cfg_obj_t *views = NULL; - cfg_obj_t *acls = NULL; - cfg_obj_t *obj; - cfg_listelt_t *velement; - isc_result_t result = ISC_R_SUCCESS; - isc_result_t tresult; - - static const char *builtin[] = { "localhost", "localnets", - "any", "none" }; - - (void)cfg_map_get(config, "options", &options); - - if (options != NULL && - check_options(options, logctx) != ISC_R_SUCCESS) - result = ISC_R_FAILURE; - - (void)cfg_map_get(config, "server", &servers); - if (servers != NULL && - check_servers(servers, logctx) != ISC_R_SUCCESS) - result = ISC_R_FAILURE; - - (void)cfg_map_get(config, "view", &views); - - if (views == NULL) { - if (check_viewconf(config, NULL, logctx, mctx) - != ISC_R_SUCCESS) - result = ISC_R_FAILURE; - } else { - cfg_obj_t *zones = NULL; - - (void)cfg_map_get(config, "zone", &zones); - if (zones != NULL) { - cfg_obj_log(zones, logctx, ISC_LOG_ERROR, - "when using 'view' statements, " - "all zones must be in views"); - result = ISC_R_FAILURE; - } - } - - for (velement = cfg_list_first(views); - velement != NULL; - velement = cfg_list_next(velement)) - { - cfg_obj_t *view = cfg_listelt_value(velement); - cfg_obj_t *voptions = cfg_tuple_get(view, "options"); - - if (check_viewconf(config, voptions, logctx, mctx) - != ISC_R_SUCCESS) - result = ISC_R_FAILURE; - } - - if (views != NULL && options != NULL) { - obj = NULL; - tresult = cfg_map_get(options, "cache-file", &obj); - if (tresult == ISC_R_SUCCESS) { - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "'cache-file' cannot be a global " - "option if views are present"); - result = ISC_R_FAILURE; - } - } - - tresult = cfg_map_get(config, "acl", &acls); - if (tresult == ISC_R_SUCCESS) { - cfg_listelt_t *elt; - cfg_listelt_t *elt2; - const char *aclname; - - for (elt = cfg_list_first(acls); - elt != NULL; - elt = cfg_list_next(elt)) { - cfg_obj_t *acl = cfg_listelt_value(elt); - unsigned int i; - - aclname = cfg_obj_asstring(cfg_tuple_get(acl, "name")); - for (i = 0; - i < sizeof(builtin) / sizeof(builtin[0]); - i++) - if (strcasecmp(aclname, builtin[i]) == 0) { - cfg_obj_log(acl, logctx, ISC_LOG_ERROR, - "attempt to redefine " - "builtin acl '%s'", - aclname); - result = ISC_R_FAILURE; - break; - } - - for (elt2 = cfg_list_next(elt); - elt2 != NULL; - elt2 = cfg_list_next(elt2)) { - cfg_obj_t *acl2 = cfg_listelt_value(elt2); - const char *name; - name = cfg_obj_asstring(cfg_tuple_get(acl2, - "name")); - if (strcasecmp(aclname, name) == 0) { - cfg_obj_log(acl2, logctx, ISC_LOG_ERROR, - "attempt to redefine " - "acl '%s'", name); - result = ISC_R_FAILURE; - break; - } - } - } - } - - return (result); -} diff --git a/usr.sbin/bind/lib/isccfg/include/isccfg/check.h b/usr.sbin/bind/lib/isccfg/include/isccfg/check.h deleted file mode 100644 index 81d547cc465..00000000000 --- a/usr.sbin/bind/lib/isccfg/include/isccfg/check.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2001 Internet Software Consortium. - * - * 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. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM - * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL - * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION - * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* $ISC: check.h,v 1.4 2001/08/03 17:24:11 gson Exp $ */ - -#ifndef ISCCFG_CHECK_H -#define ISCCFG_CHECK_H 1 - -#include <isc/lang.h> -#include <isc/types.h> - -#include <isccfg/cfg.h> - -ISC_LANG_BEGINDECLS - -isc_result_t -cfg_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx); -/* - * Check the syntactic validity of a configuration parse tree generated from - * a named.conf file. - * - * Requires: - * config is a valid parse tree - * - * logctx is a valid logging context. - * - * Returns: - * ISC_R_SUCCESS - * ISC_R_FAILURE - */ - -isc_result_t -cfg_check_key(cfg_obj_t *config, isc_log_t *logctx); -/* - * As above, but for a single 'key' statement. - */ - -ISC_LANG_ENDDECLS - -#endif /* ISCCFG_CHECK_H */ |