Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
BIND
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
580
Issues
580
List
Boards
Labels
Service Desk
Milestones
Merge Requests
113
Merge Requests
113
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
BIND
Commits
2047977c
Commit
2047977c
authored
Feb 27, 2004
by
Mark Andrews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1586. [func] "check-names" is now implemented.
parent
d437c51a
Changes
79
Hide whitespace changes
Inline
Side-by-side
Showing
79 changed files
with
2309 additions
and
234 deletions
+2309
-234
CHANGES
CHANGES
+2
-0
bin/check/named-checkzone.c
bin/check/named-checkzone.c
+13
-3
bin/check/named-checkzone.docbook
bin/check/named-checkzone.docbook
+14
-1
bin/named/config.c
bin/named/config.c
+3
-3
bin/named/query.c
bin/named/query.c
+21
-1
bin/named/server.c
bin/named/server.c
+36
-3
bin/named/update.c
bin/named/update.c
+4
-1
bin/named/zoneconf.c
bin/named/zoneconf.c
+51
-1
bin/nsupdate/nsupdate.c
bin/nsupdate/nsupdate.c
+2
-2
bin/tests/rdata_test.c
bin/tests/rdata_test.c
+3
-3
bin/tests/system/conf.sh.in
bin/tests/system/conf.sh.in
+2
-2
lib/dns/gen.c
lib/dns/gen.c
+19
-3
lib/dns/include/dns/master.h
lib/dns/include/dns/master.h
+3
-1
lib/dns/include/dns/name.h
lib/dns/include/dns/name.h
+38
-11
lib/dns/include/dns/rdata.h
lib/dns/include/dns/rdata.h
+49
-8
lib/dns/include/dns/rdataset.h
lib/dns/include/dns/rdataset.h
+2
-1
lib/dns/include/dns/resolver.h
lib/dns/include/dns/resolver.h
+5
-1
lib/dns/include/dns/result.h
lib/dns/include/dns/result.h
+4
-2
lib/dns/include/dns/view.h
lib/dns/include/dns/view.h
+2
-1
lib/dns/include/dns/zone.h
lib/dns/include/dns/zone.h
+19
-1
lib/dns/journal.c
lib/dns/journal.c
+3
-3
lib/dns/master.c
lib/dns/master.c
+88
-4
lib/dns/message.c
lib/dns/message.c
+2
-2
lib/dns/name.c
lib/dns/name.c
+113
-3
lib/dns/rdata.c
lib/dns/rdata.c
+56
-10
lib/dns/rdata/any_255/tsig_250.c
lib/dns/rdata/any_255/tsig_250.c
+30
-3
lib/dns/rdata/generic/afsdb_18.c
lib/dns/rdata/generic/afsdb_18.c
+45
-3
lib/dns/rdata/generic/cert_37.c
lib/dns/rdata/generic/cert_37.c
+29
-3
lib/dns/rdata/generic/cname_5.c
lib/dns/rdata/generic/cname_5.c
+28
-3
lib/dns/rdata/generic/dname_39.c
lib/dns/rdata/generic/dname_39.c
+28
-3
lib/dns/rdata/generic/dnskey_48.c
lib/dns/rdata/generic/dnskey_48.c
+28
-3
lib/dns/rdata/generic/ds_43.c
lib/dns/rdata/generic/ds_43.c
+28
-3
lib/dns/rdata/generic/gpos_27.c
lib/dns/rdata/generic/gpos_27.c
+28
-3
lib/dns/rdata/generic/hinfo_13.c
lib/dns/rdata/generic/hinfo_13.c
+28
-3
lib/dns/rdata/generic/isdn_20.c
lib/dns/rdata/generic/isdn_20.c
+28
-3
lib/dns/rdata/generic/key_25.c
lib/dns/rdata/generic/key_25.c
+28
-3
lib/dns/rdata/generic/loc_29.c
lib/dns/rdata/generic/loc_29.c
+28
-3
lib/dns/rdata/generic/mb_7.c
lib/dns/rdata/generic/mb_7.c
+27
-3
lib/dns/rdata/generic/md_3.c
lib/dns/rdata/generic/md_3.c
+28
-3
lib/dns/rdata/generic/mf_4.c
lib/dns/rdata/generic/mf_4.c
+28
-3
lib/dns/rdata/generic/mg_8.c
lib/dns/rdata/generic/mg_8.c
+27
-3
lib/dns/rdata/generic/minfo_14.c
lib/dns/rdata/generic/minfo_14.c
+52
-4
lib/dns/rdata/generic/mr_9.c
lib/dns/rdata/generic/mr_9.c
+28
-3
lib/dns/rdata/generic/mx_15.c
lib/dns/rdata/generic/mx_15.c
+43
-3
lib/dns/rdata/generic/ns_2.c
lib/dns/rdata/generic/ns_2.c
+44
-3
lib/dns/rdata/generic/nsec_47.c
lib/dns/rdata/generic/nsec_47.c
+28
-3
lib/dns/rdata/generic/null_10.c
lib/dns/rdata/generic/null_10.c
+28
-3
lib/dns/rdata/generic/nxt_30.c
lib/dns/rdata/generic/nxt_30.c
+28
-3
lib/dns/rdata/generic/opt_41.c
lib/dns/rdata/generic/opt_41.c
+27
-3
lib/dns/rdata/generic/proforma.c
lib/dns/rdata/generic/proforma.c
+28
-1
lib/dns/rdata/generic/ptr_12.c
lib/dns/rdata/generic/ptr_12.c
+87
-3
lib/dns/rdata/generic/rp_17.c
lib/dns/rdata/generic/rp_17.c
+45
-4
lib/dns/rdata/generic/rrsig_46.c
lib/dns/rdata/generic/rrsig_46.c
+28
-3
lib/dns/rdata/generic/rt_21.c
lib/dns/rdata/generic/rt_21.c
+45
-3
lib/dns/rdata/generic/sig_24.c
lib/dns/rdata/generic/sig_24.c
+28
-3
lib/dns/rdata/generic/soa_6.c
lib/dns/rdata/generic/soa_6.c
+60
-4
lib/dns/rdata/generic/sshfp_44.c
lib/dns/rdata/generic/sshfp_44.c
+28
-3
lib/dns/rdata/generic/tkey_249.c
lib/dns/rdata/generic/tkey_249.c
+28
-3
lib/dns/rdata/generic/txt_16.c
lib/dns/rdata/generic/txt_16.c
+28
-3
lib/dns/rdata/generic/unspec_103.c
lib/dns/rdata/generic/unspec_103.c
+28
-3
lib/dns/rdata/generic/x25_19.c
lib/dns/rdata/generic/x25_19.c
+28
-3
lib/dns/rdata/hs_4/a_1.c
lib/dns/rdata/hs_4/a_1.c
+30
-3
lib/dns/rdata/in_1/a6_38.c
lib/dns/rdata/in_1/a6_38.c
+49
-3
lib/dns/rdata/in_1/a_1.c
lib/dns/rdata/in_1/a_1.c
+28
-3
lib/dns/rdata/in_1/aaaa_28.c
lib/dns/rdata/in_1/aaaa_28.c
+28
-3
lib/dns/rdata/in_1/apl_42.c
lib/dns/rdata/in_1/apl_42.c
+31
-3
lib/dns/rdata/in_1/kx_36.c
lib/dns/rdata/in_1/kx_36.c
+33
-6
lib/dns/rdata/in_1/naptr_35.c
lib/dns/rdata/in_1/naptr_35.c
+30
-3
lib/dns/rdata/in_1/nsap-ptr_23.c
lib/dns/rdata/in_1/nsap-ptr_23.c
+30
-3
lib/dns/rdata/in_1/nsap_22.c
lib/dns/rdata/in_1/nsap_22.c
+30
-3
lib/dns/rdata/in_1/px_26.c
lib/dns/rdata/in_1/px_26.c
+32
-5
lib/dns/rdata/in_1/srv_33.c
lib/dns/rdata/in_1/srv_33.c
+47
-3
lib/dns/rdata/in_1/wks_11.c
lib/dns/rdata/in_1/wks_11.c
+28
-3
lib/dns/resolver.c
lib/dns/resolver.c
+70
-1
lib/dns/result.c
lib/dns/result.c
+4
-2
lib/dns/sdb.c
lib/dns/sdb.c
+2
-2
lib/dns/xfrin.c
lib/dns/xfrin.c
+5
-1
lib/dns/zone.c
lib/dns/zone.c
+55
-1
lib/isccfg/namedconf.c
lib/isccfg/namedconf.c
+18
-6
No files found.
CHANGES
View file @
2047977c
1586. [func] "check-names" is now implemented.
1585. [placeholder] rt10497
1584. [placeholder] rt10461
...
...
bin/check/named-checkzone.c
View file @
2047977c
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: named-checkzone.c,v 1.2
7 2004/01/07 05:27:17
marka Exp $ */
/* $Id: named-checkzone.c,v 1.2
8 2004/02/27 20:41:41
marka Exp $ */
#include <config.h>
...
...
@@ -63,7 +63,7 @@ static void
usage
(
void
)
{
fprintf
(
stderr
,
"usage: named-checkzone [-djqvD] [-c class] [-o output] "
"[-t directory] [-w directory] zonename filename
\n
"
);
"[-t directory] [-w directory]
[-k option]
zonename filename
\n
"
);
exit
(
1
);
}
...
...
@@ -84,7 +84,7 @@ main(int argc, char **argv) {
char
*
classname
=
classname_in
;
const
char
*
workdir
=
NULL
;
while
((
c
=
isc_commandline_parse
(
argc
,
argv
,
"c:dijn:qst:o:vw:D"
))
!=
EOF
)
{
while
((
c
=
isc_commandline_parse
(
argc
,
argv
,
"c:dij
k:
n:qst:o:vw:D"
))
!=
EOF
)
{
switch
(
c
)
{
case
'c'
:
classname
=
isc_commandline_argument
;
...
...
@@ -110,6 +110,16 @@ main(int argc, char **argv) {
DNS_ZONEOPT_FATALNS
;
break
;
case
'k'
:
if
(
!
strcmp
(
isc_commandline_argument
,
"check-names"
))
{
zone_options
|=
DNS_ZONEOPT_CHECKNAMES
;
}
else
if
(
!
strcmp
(
isc_commandline_argument
,
"check-names-fail"
))
{
zone_options
|=
DNS_ZONEOPT_CHECKNAMES
|
DNS_ZONEOPT_CHECKNAMESFAIL
;
}
break
;
case
'q'
:
quiet
++
;
break
;
...
...
bin/check/named-checkzone.docbook
View file @
2047977c
...
...
@@ -16,7 +16,7 @@
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: named-checkzone.docbook,v 1.
9 2004/01/07 05:27:17
marka Exp $ -->
<!-- $Id: named-checkzone.docbook,v 1.
10 2004/02/27 20:41:41
marka Exp $ -->
<refentry>
<refentryinfo>
...
...
@@ -42,6 +42,7 @@
<arg><option>
-q
</option></arg>
<arg><option>
-v
</option></arg>
<arg><option>
-c
<replaceable
class=
"parameter"
>
class
</replaceable></option></arg>
<arg><option>
-k
<replaceable
class=
"parameter"
>
mode
</replaceable></option></arg>
<arg><option>
-n
<replaceable
class=
"parameter"
>
mode
</replaceable></option></arg>
<arg><option>
-o
<replaceable
class=
"parameter"
>
filename
</replaceable></option></arg>
<arg><option>
-t
<replaceable
class=
"parameter"
>
directory
</replaceable></option></arg>
...
...
@@ -112,6 +113,18 @@
</listitem>
</varlistentry>
<varlistentry>
<term>
-k
<replaceable
class=
"parameter"
>
mode
</replaceable></term>
<listitem>
<para>
Perform
<command>
"check-name"
</command>
checks with the specified failure mode.
Possible modes are
<command>
"fail"
</command>
,
<command>
"warn"
</command>
(default) and
<command>
"ignore"
</command>
.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
-n
<replaceable
class=
"parameter"
>
mode
</replaceable></term>
<listitem>
...
...
bin/named/config.c
View file @
2047977c
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: config.c,v 1.4
3 2004/02/17 03:40:19
marka Exp $ */
/* $Id: config.c,v 1.4
4 2004/02/27 20:41:41
marka Exp $ */
#include <config.h>
...
...
@@ -120,8 +120,8 @@ options {\n\
max-cache-ttl 604800; /* 1 week */
\n
\
transfer-format many-answers;
\n
\
max-cache-size 0;
\n
\
check-names master
ignore
;
\n
\
check-names slave
ignore
;
\n
\
check-names master
fail
;
\n
\
check-names slave
warn
;
\n
\
check-names response ignore;
\n
\
enable-dnssec no; /* Make yes for 9.4. */
\n
\
\n
\
...
...
bin/named/query.c
View file @
2047977c
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: query.c,v 1.25
4 2004/02/17 03:40:20
marka Exp $ */
/* $Id: query.c,v 1.25
5 2004/02/27 20:41:41
marka Exp $ */
#include <config.h>
...
...
@@ -2418,6 +2418,26 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
version
=
NULL
;
need_wildcardproof
=
ISC_FALSE
;
if
(
client
->
view
->
checknames
&&
!
dns_rdata_checkowner
(
client
->
query
.
qname
,
client
->
message
->
rdclass
,
qtype
,
ISC_FALSE
))
{
char
namebuf
[
DNS_NAME_FORMATSIZE
];
char
typename
[
DNS_RDATATYPE_FORMATSIZE
];
char
classname
[
DNS_RDATACLASS_FORMATSIZE
];
dns_name_format
(
client
->
query
.
qname
,
namebuf
,
sizeof
(
namebuf
));
dns_rdatatype_format
(
qtype
,
typename
,
sizeof
(
typename
));
dns_rdataclass_format
(
client
->
message
->
rdclass
,
classname
,
sizeof
(
classname
));
ns_client_log
(
client
,
DNS_LOGCATEGORY_SECURITY
,
NS_LOGMODULE_QUERY
,
ISC_LOG_ERROR
,
"check-names failure %s/%s/%s"
,
namebuf
,
typename
,
classname
);
QUERY_ERROR
(
DNS_R_REFUSED
);
goto
cleanup
;
}
/*
* First we must find the right database.
*/
...
...
bin/named/server.c
View file @
2047977c
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: server.c,v 1.41
3 2004/02/24 03:31:08
marka Exp $ */
/* $Id: server.c,v 1.41
4 2004/02/27 20:41:42
marka Exp $ */
#include <config.h>
...
...
@@ -667,9 +667,10 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
dns_dispatch_t
*
dispatch6
=
NULL
;
isc_boolean_t
reused_cache
=
ISC_FALSE
;
int
i
;
char
*
str
;
c
onst
c
har
*
str
;
dns_order_t
*
order
=
NULL
;
isc_uint32_t
udpsize
;
unsigned
int
check
=
0
;
REQUIRE
(
DNS_VIEW_VALID
(
view
));
...
...
@@ -792,6 +793,38 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
dns_cache_detach
(
&
cache
);
/*
* Check-names.
*/
obj
=
NULL
;
str
=
""
;
result
=
ns_config_get
(
maps
,
"check-names"
,
&
obj
);
INSIST
(
result
==
ISC_R_SUCCESS
);
for
(
element
=
cfg_list_first
(
obj
);
element
!=
NULL
;
element
=
cfg_list_next
(
element
))
{
cfg_obj_t
*
value
,
*
type
;
value
=
cfg_listelt_value
(
element
);
type
=
cfg_tuple_get
(
value
,
"type"
);
if
(
strcasecmp
(
cfg_obj_asstring
(
type
),
"response"
)
==
0
)
{
str
=
cfg_obj_asstring
(
cfg_tuple_get
(
value
,
"mode"
));
break
;
}
}
if
(
strcasecmp
(
str
,
"fail"
)
==
0
)
{
check
=
DNS_RESOLVER_CHECKNAMES
|
DNS_RESOLVER_CHECKNAMESFAIL
;
view
->
checknames
=
ISC_TRUE
;
}
else
if
(
strcasecmp
(
str
,
"warn"
)
==
0
)
{
check
=
DNS_RESOLVER_CHECKNAMES
;
view
->
checknames
=
ISC_FALSE
;
}
else
if
(
strcasecmp
(
str
,
"ignore"
)
==
0
)
{
check
=
0
;
view
->
checknames
=
ISC_FALSE
;
}
else
INSIST
(
0
);
/*
* Resolver.
*
...
...
@@ -808,7 +841,7 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
}
CHECK
(
dns_view_createresolver
(
view
,
ns_g_taskmgr
,
31
,
ns_g_socketmgr
,
ns_g_timermgr
,
0
,
ns_g_dispatchmgr
,
check
,
ns_g_dispatchmgr
,
dispatch4
,
dispatch6
));
if
(
dispatch4
!=
NULL
)
dns_dispatch_detach
(
&
dispatch4
);
...
...
bin/named/update.c
View file @
2047977c
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: update.c,v 1.10
7 2004/02/03 00:59:03
marka Exp $ */
/* $Id: update.c,v 1.10
8 2004/02/27 20:41:42
marka Exp $ */
#include <config.h>
...
...
@@ -2291,6 +2291,9 @@ update_action(isc_task_t *task, isc_event_t *event) {
FAILC
(
DNS_R_FORMERR
,
"meta-RR in update"
);
}
result
=
dns_zone_checknames
(
zone
,
name
,
&
rdata
);
if
(
result
!=
ISC_R_SUCCESS
)
FAIL
(
DNS_R_REFUSED
);
}
else
if
(
update_class
==
dns_rdataclass_any
)
{
if
(
ttl
!=
0
||
rdata
.
length
!=
0
||
(
dns_rdatatype_ismeta
(
rdata
.
type
)
&&
...
...
bin/named/zoneconf.c
View file @
2047977c
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: zoneconf.c,v 1.10
8 2004/01/05 06:56:44
marka Exp $ */
/* $Id: zoneconf.c,v 1.10
9 2004/02/27 20:41:42
marka Exp $ */
#include <config.h>
...
...
@@ -292,6 +292,41 @@ strtoargv(isc_mem_t *mctx, char *s, unsigned int *argcp, char ***argvp) {
return
(
strtoargvsub
(
mctx
,
s
,
argcp
,
argvp
,
0
));
}
static
void
checknames
(
dns_zonetype_t
ztype
,
cfg_obj_t
**
maps
,
cfg_obj_t
**
objp
)
{
const
char
*
zone
=
NULL
;
cfg_listelt_t
*
element
;
cfg_obj_t
*
type
;
cfg_obj_t
*
value
;
cfg_obj_t
*
check
;
int
i
;
switch
(
ztype
)
{
case
dns_zone_slave
:
zone
=
"slave"
;
break
;
case
dns_zone_master
:
zone
=
"master"
;
break
;
default:
INSIST
(
0
);
}
for
(
i
=
0
;
maps
[
i
]
!=
NULL
;
i
++
)
{
check
=
NULL
;
cfg_map_get
(
maps
[
i
],
"check-names"
,
&
check
);
if
(
check
!=
NULL
&&
!
cfg_obj_islist
(
check
))
{
*
objp
=
check
;
return
;
}
for
(
element
=
cfg_list_first
(
check
);
element
!=
NULL
;
element
=
cfg_list_next
(
element
))
{
value
=
cfg_listelt_value
(
element
);
type
=
cfg_tuple_get
(
value
,
"type"
);
if
(
strcasecmp
(
cfg_obj_asstring
(
type
),
zone
)
==
0
)
{
*
objp
=
cfg_tuple_get
(
value
,
"mode"
);
return
;
}
}
}
}
isc_result_t
ns_zone_configure
(
cfg_obj_t
*
config
,
cfg_obj_t
*
vconfig
,
cfg_obj_t
*
zconfig
,
ns_aclconfctx_t
*
ac
,
dns_zone_t
*
zone
)
...
...
@@ -321,6 +356,7 @@ ns_zone_configure(cfg_obj_t *config, cfg_obj_t *vconfig, cfg_obj_t *zconfig,
isc_boolean_t
multi
;
isc_boolean_t
alt
;
dns_view_t
*
view
;
isc_boolean_t
check
=
ISC_FALSE
,
fail
=
ISC_FALSE
;
i
=
0
;
if
(
zconfig
!=
NULL
)
{
...
...
@@ -514,6 +550,20 @@ ns_zone_configure(cfg_obj_t *config, cfg_obj_t *vconfig, cfg_obj_t *zconfig,
INSIST
(
result
==
ISC_R_SUCCESS
);
dns_zone_setoption
(
zone
,
DNS_ZONEOPT_IXFRFROMDIFFS
,
cfg_obj_asboolean
(
obj
));
checknames
(
ztype
,
maps
,
&
obj
);
INSIST
(
obj
!=
NULL
);
if
(
strcasecmp
(
cfg_obj_asstring
(
obj
),
"warn"
)
==
0
)
{
fail
=
ISC_FALSE
;
check
=
ISC_TRUE
;
}
else
if
(
strcasecmp
(
cfg_obj_asstring
(
obj
),
"fail"
)
==
0
)
{
fail
=
check
=
ISC_TRUE
;
}
else
if
(
strcasecmp
(
cfg_obj_asstring
(
obj
),
"ignore"
)
==
0
)
{
fail
=
check
=
ISC_FALSE
;
}
else
INSIST
(
0
);
dns_zone_setoption
(
zone
,
DNS_ZONEOPT_CHECKNAMES
,
check
);
dns_zone_setoption
(
zone
,
DNS_ZONEOPT_CHECKNAMESFAIL
,
fail
);
}
/*
...
...
bin/nsupdate/nsupdate.c
View file @
2047977c
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: nsupdate.c,v 1.12
3 2003/07/25 02:22:23
marka Exp $ */
/* $Id: nsupdate.c,v 1.12
4 2004/02/27 20:41:42
marka Exp $ */
#include <config.h>
...
...
@@ -758,7 +758,7 @@ parse_rdata(char **cmdlinep, dns_rdataclass_t rdataclass,
result
=
isc_buffer_allocate
(
mctx
,
&
buf
,
MAXWIRE
);
check_result
(
result
,
"isc_buffer_allocate"
);
result
=
dns_rdata_fromtext
(
rdata
,
rdataclass
,
rdatatype
,
lex
,
rn
,
ISC_FALSE
,
mctx
,
buf
,
rn
,
0
,
mctx
,
buf
,
&
callbacks
);
isc_lex_destroy
(
&
lex
);
if
(
result
==
ISC_R_SUCCESS
)
{
...
...
bin/tests/rdata_test.c
View file @
2047977c
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rdata_test.c,v 1.
39 2003/09/30 05:56:0
2 marka Exp $ */
/* $Id: rdata_test.c,v 1.
40 2004/02/27 20:41:4
2 marka Exp $ */
#include <config.h>
...
...
@@ -1013,7 +1013,7 @@ main(int argc, char *argv[]) {
dns_rdata_init
(
&
rdata
);
isc_buffer_init
(
&
dbuf
,
inbuf
,
sizeof
(
inbuf
));
result
=
dns_rdata_fromtext
(
&
rdata
,
class
,
type
,
lex
,
NULL
,
ISC_FALSE
,
mctx
,
&
dbuf
,
NULL
,
0
,
mctx
,
&
dbuf
,
NULL
);
if
(
result
!=
ISC_R_SUCCESS
)
{
fprintf
(
stdout
,
...
...
@@ -1086,7 +1086,7 @@ main(int argc, char *argv[]) {
isc_buffer_init
(
&
dbuf
,
inbuf
,
sizeof
(
inbuf
));
dns_decompress_init
(
&
dctx
,
-
1
,
DNS_DECOMPRESS_ANY
);
result
=
dns_rdata_fromwire
(
&
rdata
,
class
,
type
,
&
wbuf
,
&
dctx
,
ISC_FALSE
,
&
dbuf
);
&
dctx
,
0
,
&
dbuf
);
dns_decompress_invalidate
(
&
dctx
);
if
(
result
!=
ISC_R_SUCCESS
)
{
fprintf
(
stdout
,
...
...
bin/tests/system/conf.sh.in
View file @
2047977c
...
...
@@ -15,7 +15,7 @@
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# $Id: conf.sh.in,v 1.2
5 2003/09/30 05:56:06
marka Exp $
# $Id: conf.sh.in,v 1.2
6 2004/02/27 20:41:43
marka Exp $
#
# Common configuration data for system tests, to be sourced into
...
...
@@ -41,7 +41,7 @@ SIGNER=$TOP/bin/dnssec/dnssec-signzone
# The "stress" test is not run by default since it creates enough
# load on the machine to make it unusable to other users.
# v6synth
SUBDIRS
=
"cacheclean dnssec forward glue ixfr limits lwresd
\
SUBDIRS
=
"cacheclean
checknames
dnssec forward glue ixfr limits lwresd
\
masterfile notify nsupdate resolver sortlist stub tkey
\
unknown upforwd views xfer xferquota"
...
...
lib/dns/gen.c
View file @
2047977c
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: gen.c,v 1.7
0 2003/07/25 00:01:05
marka Exp $ */
/* $Id: gen.c,v 1.7
1 2004/02/27 20:41:43
marka Exp $ */
#include <config.h>
...
...
@@ -34,7 +34,7 @@
#include "gen-unix.h"
#endif
#define FROMTEXTARGS "rdclass, type, lexer, origin,
downcase
, target, callbacks"
#define FROMTEXTARGS "rdclass, type, lexer, origin,
options
, target, callbacks"
#define FROMTEXTCLASS "rdclass"
#define FROMTEXTTYPE "type"
#define FROMTEXTDEF "result = DNS_R_UNKNOWN"
...
...
@@ -44,7 +44,7 @@
#define TOTEXTTYPE "rdata->type"
#define TOTEXTDEF "use_default = ISC_TRUE"
#define FROMWIREARGS "rdclass, type, source, dctx,
downcase
, target"
#define FROMWIREARGS "rdclass, type, source, dctx,
options
, target"
#define FROMWIRECLASS "rdclass"
#define FROMWIRETYPE "type"
#define FROMWIREDEF "use_default = ISC_TRUE"
...
...
@@ -84,6 +84,16 @@
#define DIGESTTYPE "rdata->type"
#define DIGESTDEF "use_default = ISC_TRUE"
#define CHECKOWNERARGS "name, rdclass, type, wildcard"
#define CHECKOWNERCLASS "rdclass"
#define CHECKOWNERTYPE "type"
#define CHECKOWNERDEF "result = ISC_TRUE"
#define CHECKNAMESARGS "rdata, owner, bad"
#define CHECKNAMESCLASS "rdata->rdclass"
#define CHECKNAMESTYPE "rdata->type"
#define CHECKNAMESDEF "result = ISC_TRUE"
const
char
copyright
[]
=
"/*
\n
"
" * Copyright (C) 1998%s Internet Software Consortium.
\n
"
...
...
@@ -620,6 +630,12 @@ main(int argc, char **argv) {
doswitch
(
"DIGESTSWITCH"
,
"digest"
,
DIGESTARGS
,
DIGESTTYPE
,
DIGESTCLASS
,
DIGESTDEF
);
doswitch
(
"CHECKOWNERSWITCH"
,
"checkowner"
,
CHECKOWNERARGS
,
CHECKOWNERTYPE
,
CHECKOWNERCLASS
,
CHECKOWNERDEF
);
doswitch
(
"CHECKNAMESSWITCH"
,
"checknames"
,
CHECKNAMESARGS
,
CHECKNAMESTYPE
,
CHECKNAMESCLASS
,
CHECKNAMESDEF
);
/*
* From here down, we are processing the rdata names and
...
...
lib/dns/include/dns/master.h
View file @
2047977c
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: master.h,v 1.3
6 2002/07/19 02:34:56
marka Exp $ */
/* $Id: master.h,v 1.3
7 2004/02/27 20:41:45
marka Exp $ */
#ifndef DNS_MASTER_H
#define DNS_MASTER_H 1
...
...
@@ -43,6 +43,8 @@
* they are an address */
#define DNS_MASTER_FATALNS 0x00000080
/* Treat DNS_MASTER_CHECKNS
* matches as fatal */
#define DNS_MASTER_CHECKNAMES 0x00000100
#define DNS_MASTER_CHECKNAMESFAIL 0x00000200
ISC_LANG_BEGINDECLS
...
...
lib/dns/include/dns/name.h
View file @
2047977c
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: name.h,v 1.10
4 2003/10/25 00:31:12 jinmei
Exp $ */
/* $Id: name.h,v 1.10
5 2004/02/27 20:41:45 marka
Exp $ */
#ifndef DNS_NAME_H
#define DNS_NAME_H 1
...
...
@@ -140,7 +140,12 @@ struct dns_name {
#define DNS_NAMEATTR_NCACHE 0x0400
/* Used by resolver. */
#define DNS_NAMEATTR_CHAINING 0x0800
/* Used by resolver. */
#define DNS_NAMEATTR_CHASE 0x1000
/* Used by resolver. */
#define DNS_NAMEATTR_WILDCARD 0x2000
/* Used by server */
#define DNS_NAMEATTR_WILDCARD 0x2000
/* Used by server. */
#define DNS_NAME_DOWNCASE 0x0001
#define DNS_NAME_CHECKNAMES 0x0002
/* Used by rdata. */
#define DNS_NAME_CHECKNAMESFAIL 0x0004
/* Used by rdata. */
#define DNS_NAME_CHECKREVERSE 0x0008
/* Used by rdata. */
LIBDNS_EXTERNAL_DATA
extern
dns_name_t
*
dns_rootname
;
LIBDNS_EXTERNAL_DATA
extern
dns_name_t
*
dns_wildcardname
;
...
...
@@ -639,7 +644,7 @@ dns_name_toregion(dns_name_t *name, isc_region_t *r);
isc_result_t
dns_name_fromwire
(
dns_name_t
*
name
,
isc_buffer_t
*
source
,
dns_decompress_t
*
dctx
,
isc_boolean_t
downcase
,
dns_decompress_t
*
dctx
,
unsigned
int
options
,
isc_buffer_t
*
target
);
/*
* Copy the possibly-compressed name at source (active region) into target,
...
...
@@ -648,7 +653,7 @@ dns_name_fromwire(dns_name_t *name, isc_buffer_t *source,
* Notes:
* Decompression policy is controlled by 'dctx'.
*
* If
'downcase' is true
, any uppercase letters in 'source' will be
* If
DNS_NAME_DOWNCASE is set
, any uppercase letters in 'source' will be
* downcased when they are copied into 'target'.
*
* Security:
...
...
@@ -676,8 +681,8 @@ dns_name_fromwire(dns_name_t *name, isc_buffer_t *source,
* If result is success:
* If 'target' is not NULL, 'name' is attached to it.
*
* Uppercase letters are downcased in the copy iff
. 'downcase' is
*
true
.
* Uppercase letters are downcased in the copy iff
*
DNS_NAME_DOWNCASE is set in options
.
*
* The current location in source is advanced, and the used space
* in target is updated.
...
...
@@ -729,7 +734,7 @@ dns_name_towire(dns_name_t *name, dns_compress_t *cctx, isc_buffer_t *target);
isc_result_t
dns_name_fromtext
(
dns_name_t
*
name
,
isc_buffer_t
*
source
,
dns_name_t
*
origin
,
isc_boolean_t
downcase
,
dns_name_t
*
origin
,
unsigned
int
options
,
isc_buffer_t
*
target
);
/*
* Convert the textual representation of a DNS name at source
...
...
@@ -740,8 +745,8 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source,
* unless 'origin' is NULL, in which case relative domain names
* will remain relative.
*
* If
'downcase' is true, any uppercase letters in 'source' will be
* downcased when they are copied into 'target'.
* If
DNS_NAME_DOWNCASE is set in 'options', any uppercase letters
*
in 'source' will be
downcased when they are copied into 'target'.
*
* Requires:
*
...
...
@@ -757,8 +762,8 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source,
* If result is success:
* If 'target' is not NULL, 'name' is attached to it.
*
* Uppercase letters are downcased in the copy iff
. 'downcase' is
*
true
.
* Uppercase letters are downcased in the copy iff
*
DNS_NAME_DOWNCASE is set in 'options'
.
*
* The current location in source is advanced, and the used space
* in target is updated.
...
...
@@ -1137,6 +1142,28 @@ dns_name_copy(dns_name_t *source, dns_name_t *dest, isc_buffer_t *target);
* ISC_R_NOSPACE
*/
isc_boolean_t
dns_name_ishostname
(
const
dns_name_t
*
name
,
isc_boolean_t
wildcard
);
/*
* Return if 'name' is a valid hostname. RFC 952 / RFC 1123.
* If 'wildcard' is ISC_TRUE then allow the first label of name to
* be a wildcard.
* The root is also accepted.
*
* Requires:
* 'name' to be valid.
*/
isc_boolean_t
dns_name_ismailbox
(
const
dns_name_t
*
name
);
/*
* Return if 'name' is a valid mailbox. RFC 821.
*
* Requires:
* 'name' to be valid.
*/
ISC_LANG_ENDDECLS
/***
...
...
lib/dns/include/dns/rdata.h
View file @
2047977c
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rdata.h,v 1.5
8 2003/10/17 03:46
:45 marka Exp $ */
/* $Id: rdata.h,v 1.5
9 2004/02/27 20:41
:45 marka Exp $ */
#ifndef DNS_RDATA_H
#define DNS_RDATA_H 1
...
...
@@ -96,6 +96,7 @@
#include <isc/lang.h>
#include <dns/types.h>
#include <dns/name.h>
ISC_LANG_BEGINDECLS
...
...
@@ -142,6 +143,11 @@ struct dns_rdata {
/* Output explanatory comments. */
#define DNS_STYLEFLAG_COMMENT 0x00000002U
#define DNS_RDATA_DOWNCASE DNS_NAME_DOWNCASE
#define DNS_RDATA_CHECKNAMES DNS_NAME_CHECKNAMES
#define DNS_RDATA_CHECKNAMESFAIL DNS_NAME_CHECKNAMESFAIL
#define DNS_RDATA_CHECKREVERSE DNS_NAME_CHECKREVERSE
/***
*** Initialization
***/
...
...
@@ -220,8 +226,7 @@ dns_rdata_toregion(const dns_rdata_t *rdata, isc_region_t *r);
isc_result_t
dns_rdata_fromwire
(
dns_rdata_t
*
rdata
,
dns_rdataclass_t
rdclass
,
dns_rdatatype_t
type
,
isc_buffer_t
*
source
,
dns_decompress_t
*
dctx
,
isc_boolean_t
downcase
,
dns_decompress_t
*
dctx
,
unsigned
int
options
,
isc_buffer_t
*
target
);
/*
* Copy the possibly-compressed rdata at source into the target region.
...
...
@@ -229,8 +234,9 @@ dns_rdata_fromwire(dns_rdata_t *rdata, dns_rdataclass_t rdclass,
* Notes:
* Name decompression policy is controlled by 'dctx'.
*
* If 'downcase' is true, any uppercase letters in domain names in
* 'source' will be downcased when they are copied into 'target'.
* 'options'
* DNS_RDATA_DOWNCASE downcase domain names when they are copied
* into target.
*
* Requires:
*
...
...
@@ -294,7 +300,7 @@ dns_rdata_towire(dns_rdata_t *rdata, dns_compress_t *cctx,
isc_result_t
dns_rdata_fromtext
(
dns_rdata_t
*
rdata
,
dns_rdataclass_t
rdclass
,
dns_rdatatype_t
type
,
isc_lex_t
*
lexer
,
dns_name_t
*
origin
,
isc_boolean_t
downcase
,
isc_mem_t
*
mctx
,
unsigned
int
options
,
isc_mem_t
*
mctx
,
isc_buffer_t
*
target
,
dns_rdatacallbacks_t
*
callbacks
);
/*
* Convert the textual representation of a DNS rdata into uncompressed wire
...
...
@@ -305,8 +311,15 @@ dns_rdata_fromtext(dns_rdata_t *rdata, dns_rdataclass_t rdclass,
* Relative domain names in the rdata will have 'origin' appended to them.
* A NULL origin implies "origin == dns_rootname".
*
* If 'downcase' is true, any uppercase letters in domain names in
* 'source' will be downcased when they are copied into 'target'.
*
* 'options'
* DNS_RDATA_DOWNCASE downcase domain names when they are copied
* into target.
* DNS_RDATA_CHECKNAMES perform checknames checks.
* DNS_RDATA_CHECKNAMESFAIL fail if the checknames check fail. If
* not set a warning will be issued.
* DNS_RDATA_CHECKREVERSE this should set if the owner name ends
* in IP6.ARPA, IP6.INT or IN-ADDR.ARPA.
*
* Requires:
*
...
...
@@ -660,6 +673,34 @@ dns_rdata_covers(dns_rdata_t *rdata);
* The type covered.
*/
isc_boolean_t
dns_rdata_checkowner
(
dns_name_t
*
name
,
dns_rdataclass_t
rdclass
,