2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00

313. [bug] When parsing resolv.conf, don't terminate on an

error.  Instead, parse as much as possible, but
                        still return an error if one was found.
This commit is contained in:
Brian Wellington
2000-07-07 18:58:46 +00:00
parent 03968c0f5e
commit d8c8722f28
3 changed files with 14 additions and 6 deletions

View File

@@ -1,3 +1,7 @@
313. [bug] When parsing resolv.conf, don't terminate on an
error. Instead, parse as much as possible, but
still return an error if one was found.
312. [bug] Increase the number of allowed elements in the
resolv.conf search path from 6 to 8. If there
are more than this, ignore the remainder rather

View File

@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: lwres.h,v 1.40 2000/07/07 18:24:11 bwelling Exp $ */
/* $Id: lwres.h,v 1.41 2000/07/07 18:58:45 bwelling Exp $ */
#ifndef LWRES_LWRES_H
#define LWRES_LWRES_H 1
@@ -423,7 +423,8 @@ lwres_conf_parse(lwres_context_t *ctx, const char *filename);
*
* Returns:
* LWRES_R_SUCCESS on a successful parse.
* Anything else on error.
* Anything else on error, although the structure may be partially filled
* in.
*/
lwres_result_t

View File

@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: lwconfig.c,v 1.21 2000/07/07 18:28:58 bwelling Exp $ */
/* $Id: lwconfig.c,v 1.22 2000/07/07 18:58:46 bwelling Exp $ */
/***
*** Module for parsing resolv.conf files.
@@ -517,7 +517,7 @@ lwres_result_t
lwres_conf_parse(lwres_context_t *ctx, const char *filename) {
FILE *fp = NULL;
char word[256];
lwres_result_t rval;
lwres_result_t rval, ret;
lwres_conf_t *confdata;
int stopchar;
@@ -532,6 +532,7 @@ lwres_conf_parse(lwres_context_t *ctx, const char *filename) {
if ((fp = fopen(filename, "r")) == NULL)
return (LWRES_R_FAILURE);
ret = LWRES_R_SUCCESS;
do {
stopchar = getword(fp, word, sizeof(word));
if (stopchar == EOF) {
@@ -559,11 +560,13 @@ lwres_conf_parse(lwres_context_t *ctx, const char *filename) {
break;
}
}
} while (rval == LWRES_R_SUCCESS);
if (ret == LWRES_R_SUCCESS && rval != LWRES_R_SUCCESS)
ret = rval;
} while (1);
fclose(fp);
return (rval);
return (ret);
}
lwres_result_t