mirror of
https://github.com/isc-projects/bind9.git
synced 2026-03-10 02:01:32 -04:00
Properly process extra nameserver lines in resolv.conf
The whole line needs to be read rather than just the token "nameserver" otherwise the next line in resolv.conf is not properly processed.
This commit is contained in:
parent
15eaf9d3f2
commit
864cd08052
1 changed files with 4 additions and 4 deletions
|
|
@ -288,10 +288,6 @@ resconf_parsenameserver(irs_resconf_t *conf, FILE *fp) {
|
|||
int cp;
|
||||
isc_result_t result;
|
||||
|
||||
if (conf->numns == RESCONFMAXNAMESERVERS) {
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
cp = getword(fp, word, sizeof(word));
|
||||
if (strlen(word) == 0U) {
|
||||
return (ISC_R_UNEXPECTEDEND); /* Nothing on line. */
|
||||
|
|
@ -303,6 +299,10 @@ resconf_parsenameserver(irs_resconf_t *conf, FILE *fp) {
|
|||
return (ISC_R_UNEXPECTEDTOKEN); /* Extra junk on line. */
|
||||
}
|
||||
|
||||
if (conf->numns == RESCONFMAXNAMESERVERS) {
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
result = add_server(conf->mctx, word, &conf->nameservers);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
|
|
|
|||
Loading…
Reference in a new issue