Commit d8c8722f authored by Brian Wellington's avatar Brian Wellington
Browse files

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.
parent 03968c0f
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
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment