From f42e70d3ac264107410451663fad861fd76d193c Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Mon, 10 Jul 2000 23:20:12 +0000 Subject: [PATCH] pullup: 311. [bug] lwres_conf_parse failed when the first line of resolv.conf was empty or a comment. --- CHANGES | 3 +++ lib/lwres/lwconfig.c | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index d71ac266c6..e9ed3a4762 100644 --- a/CHANGES +++ b/CHANGES @@ -23,6 +23,9 @@ are more than this, ignore the remainder rather than returning a failure in lwres_conf_parse. + 311. [bug] lwres_conf_parse failed when the first line of + resolv.conf was empty or a comment. + 309. [bug] When sending a referral, the server did not look for name server addresses as glue in the zone holding the NS RRset in the case where this zone diff --git a/lib/lwres/lwconfig.c b/lib/lwres/lwconfig.c index c160131998..8cbd1ba23f 100644 --- a/lib/lwres/lwconfig.c +++ b/lib/lwres/lwconfig.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: lwconfig.c,v 1.15.2.2 2000/07/10 20:58:07 gson Exp $ */ +/* $Id: lwconfig.c,v 1.15.2.3 2000/07/10 23:20:12 gson Exp $ */ /*** *** Module for parsing resolv.conf files. @@ -536,7 +536,6 @@ lwres_conf_parse(lwres_context_t *ctx, const char *filename) { REQUIRE(strlen(filename) > 0); REQUIRE(confdata != NULL); - rval = LWRES_R_FAILURE; /* Make compiler happy. */ errno = 0; if ((fp = fopen(filename, "r")) == NULL) return (LWRES_R_FAILURE); @@ -549,7 +548,9 @@ lwres_conf_parse(lwres_context_t *ctx, const char *filename) { 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); else if (strcmp(word, "domain") == 0) rval = lwres_conf_parsedomain(ctx, fp);