mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
Check that the hostname of the server is legal
This commit is contained in:
@@ -533,9 +533,7 @@ generic_fromtext_in_svcb(ARGS_FROMTEXT) {
|
|||||||
dns_name_t name;
|
dns_name_t name;
|
||||||
isc_buffer_t buffer;
|
isc_buffer_t buffer;
|
||||||
bool alias;
|
bool alias;
|
||||||
#if 0
|
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
#endif
|
|
||||||
unsigned int used;
|
unsigned int used;
|
||||||
|
|
||||||
UNUSED(type);
|
UNUSED(type);
|
||||||
@@ -565,7 +563,6 @@ generic_fromtext_in_svcb(ARGS_FROMTEXT) {
|
|||||||
origin = dns_rootname;
|
origin = dns_rootname;
|
||||||
}
|
}
|
||||||
RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
|
RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
|
||||||
#if 0
|
|
||||||
if (!alias && (options & DNS_RDATA_CHECKNAMES) != 0) {
|
if (!alias && (options & DNS_RDATA_CHECKNAMES) != 0) {
|
||||||
ok = dns_name_ishostname(&name, false);
|
ok = dns_name_ishostname(&name, false);
|
||||||
}
|
}
|
||||||
@@ -575,7 +572,6 @@ generic_fromtext_in_svcb(ARGS_FROMTEXT) {
|
|||||||
if (!ok && callbacks != NULL) {
|
if (!ok && callbacks != NULL) {
|
||||||
warn_badname(&name, lexer, callbacks);
|
warn_badname(&name, lexer, callbacks);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (alias) {
|
if (alias) {
|
||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
@@ -1180,27 +1176,24 @@ checkowner_in_svcb(ARGS_CHECKOWNER) {
|
|||||||
|
|
||||||
static inline bool
|
static inline bool
|
||||||
generic_checknames_in_svcb(ARGS_CHECKNAMES) {
|
generic_checknames_in_svcb(ARGS_CHECKNAMES) {
|
||||||
#if 0
|
|
||||||
isc_region_t region;
|
isc_region_t region;
|
||||||
dns_name_t name;
|
dns_name_t name;
|
||||||
#endif
|
bool alias;
|
||||||
|
|
||||||
UNUSED(rdata);
|
|
||||||
UNUSED(bad);
|
|
||||||
UNUSED(owner);
|
UNUSED(owner);
|
||||||
|
|
||||||
#if 0
|
|
||||||
dns_rdata_toregion(rdata, ®ion);
|
dns_rdata_toregion(rdata, ®ion);
|
||||||
|
INSIST(region.length > 1);
|
||||||
|
alias = uint16_fromregion(®ion) == 0;
|
||||||
isc_region_consume(®ion, 2);
|
isc_region_consume(®ion, 2);
|
||||||
dns_name_init(&name, NULL);
|
dns_name_init(&name, NULL);
|
||||||
dns_name_fromregion(&name, ®ion);
|
dns_name_fromregion(&name, ®ion);
|
||||||
if (!dns_name_ishostname(&name, false)) {
|
if (!alias && !dns_name_ishostname(&name, false)) {
|
||||||
if (bad != NULL) {
|
if (bad != NULL) {
|
||||||
dns_name_clone(&name, bad);
|
dns_name_clone(&name, bad);
|
||||||
}
|
}
|
||||||
return (false);
|
return (false);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return (true);
|
return (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user