From 1275a72e8db349ce249c84804b2b4861d33d4db7 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Sun, 19 Nov 2000 22:12:42 +0000 Subject: [PATCH] Don't allow metatypes to be loaded using the \# format. --- lib/dns/include/dns/result.h | 5 +++-- lib/dns/rdata.c | 4 +++- lib/dns/result.c | 5 +++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/dns/include/dns/result.h b/lib/dns/include/dns/result.h index ea8c8f0794..8af10a588a 100644 --- a/lib/dns/include/dns/result.h +++ b/lib/dns/include/dns/result.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: result.h,v 1.72 2000/11/15 00:51:16 gson Exp $ */ +/* $Id: result.h,v 1.73 2000/11/19 22:12:42 bwelling Exp $ */ #ifndef DNS_RESULT_H #define DNS_RESULT_H 1 @@ -106,8 +106,9 @@ #define DNS_R_NOTEXACT (ISC_RESULTCLASS_DNS + 67) #define DNS_R_BLACKHOLED (ISC_RESULTCLASS_DNS + 68) #define DNS_R_BADALG (ISC_RESULTCLASS_DNS + 69) +#define DNS_R_METATYPE (ISC_RESULTCLASS_DNS + 70) -#define DNS_R_NRESULTS 70 /* Number of results */ +#define DNS_R_NRESULTS 71 /* Number of results */ /* * DNS wire format rcodes. diff --git a/lib/dns/rdata.c b/lib/dns/rdata.c index 93ebaca40c..b98bb245cb 100644 --- a/lib/dns/rdata.c +++ b/lib/dns/rdata.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rdata.c,v 1.125 2000/11/15 19:11:34 gson Exp $ */ +/* $Id: rdata.c,v 1.126 2000/11/19 22:12:39 bwelling Exp $ */ #include #include @@ -601,6 +601,8 @@ dns_rdata_fromtext(dns_rdata_t *rdata, dns_rdataclass_t rdclass, if (result == ISC_R_SUCCESS) result = isc_hex_tobuffer(lexer, target, token.value.as_ulong); + if (result == ISC_R_SUCCESS && dns_rdatatype_ismeta(type)) + result = DNS_R_METATYPE; if (result == ISC_R_SUCCESS && dns_rdatatype_isknown(type)) result = rdata_valid(target, rdclass, type, mctx); } else { diff --git a/lib/dns/result.c b/lib/dns/result.c index 8adfa1a39c..dde4d4efed 100644 --- a/lib/dns/result.c +++ b/lib/dns/result.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: result.c,v 1.78 2000/11/15 00:51:17 gson Exp $ */ +/* $Id: result.c,v 1.79 2000/11/19 22:12:41 bwelling Exp $ */ #include @@ -108,7 +108,8 @@ static const char *text[DNS_R_NRESULTS] = { "seen include file", /* 66 DNS_R_SEENINCLUDE */ "not exact", /* 67 DNS_R_NOTEXACT */ "address blackholed", /* 68 DNS_R_BLACKHOLED */ - "bad algorithm" /* 69 DNS_R_BADALG */ + "bad algorithm", /* 69 DNS_R_BADALG */ + "invalid use of a meta type" /* 70 DNS_R_METATYPE */ }; static const char *rcode_text[DNS_R_NRCODERESULTS] = {