2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 22:45:39 +00:00

311. [bug] lwres_conf_parse failed when the first line of

resolv.conf was empty or a comment.
This commit is contained in:
Brian Wellington
2000-07-07 18:16:46 +00:00
parent 524c8ea0dc
commit a4b496f2ab
2 changed files with 7 additions and 3 deletions

View File

@@ -1,3 +1,6 @@
311. [bug] lwres_conf_parse failed when the first line of
resolv.conf was empty or a comment.
310. [func] Changes to named.conf "controls" statement (inet 310. [func] Changes to named.conf "controls" statement (inet
subtype only) subtype only)

View File

@@ -15,7 +15,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
/* $Id: lwconfig.c,v 1.18 2000/07/06 20:05:12 bwelling Exp $ */ /* $Id: lwconfig.c,v 1.19 2000/07/07 18:16:46 bwelling Exp $ */
/*** /***
*** Module for parsing resolv.conf files. *** Module for parsing resolv.conf files.
@@ -527,7 +527,6 @@ lwres_conf_parse(lwres_context_t *ctx, const char *filename) {
REQUIRE(strlen(filename) > 0); REQUIRE(strlen(filename) > 0);
REQUIRE(confdata != NULL); REQUIRE(confdata != NULL);
rval = LWRES_R_FAILURE; /* Make compiler happy. */
errno = 0; errno = 0;
if ((fp = fopen(filename, "r")) == NULL) if ((fp = fopen(filename, "r")) == NULL)
return (LWRES_R_FAILURE); return (LWRES_R_FAILURE);
@@ -539,7 +538,9 @@ lwres_conf_parse(lwres_context_t *ctx, const char *filename) {
break; break;
} }
if (strcmp(word, "nameserver") == 0) if (strlen(word) == 0)
rval = LWRES_R_SUCCESS;
else if (strcmp(word, "nameserver") == 0)
rval = lwres_conf_parsenameserver(ctx, fp); rval = lwres_conf_parsenameserver(ctx, fp);
else if (strcmp(word, "domain") == 0) else if (strcmp(word, "domain") == 0)
rval = lwres_conf_parsedomain(ctx, fp); rval = lwres_conf_parsedomain(ctx, fp);