public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in net-dns/bind-tools/files: bind-tools-9.5.0_p1-lwconfig.patch
@ 2008-07-23 19:01 Tobias Scherbaum (dertobi123)
  0 siblings, 0 replies; only message in thread
From: Tobias Scherbaum (dertobi123) @ 2008-07-23 19:01 UTC (permalink / raw
  To: gentoo-commits

dertobi123    08/07/23 19:01:12

  Added:                bind-tools-9.5.0_p1-lwconfig.patch
  Log:
  Add patch to fix parsing of resolv.conf by host/dig, #231247
  (Portage version: 2.2_rc2/cvs/Linux 2.6.25-gentoo-r6 x86_64)

Revision  Changes    Path
1.1                  net-dns/bind-tools/files/bind-tools-9.5.0_p1-lwconfig.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-dns/bind-tools/files/bind-tools-9.5.0_p1-lwconfig.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-dns/bind-tools/files/bind-tools-9.5.0_p1-lwconfig.patch?rev=1.1&content-type=text/plain

Index: bind-tools-9.5.0_p1-lwconfig.patch
===================================================================
--- lib/lwres/lwconfig.c.old	2007-06-20 01:47:22.000000000 +0200
+++ lib/lwres/lwconfig.c	2008-06-15 02:57:02.000000000 +0200
@@ -175,13 +175,8 @@
 	REQUIRE(buffer != NULL);
 	REQUIRE(size > 0U);
 
-	*p = '\0';
-
 	ch = eatwhite(fp);
 
-	if (ch == EOF)
-		return (EOF);
-
 	do {
 		*p = '\0';
 
@@ -592,23 +587,37 @@
 		if (strlen(word) == 0U)
 			rval = LWRES_R_SUCCESS;
 		else if (strcmp(word, "nameserver") == 0)
-			rval = lwres_conf_parsenameserver(ctx, fp);
+			rval = (stopchar != '\n')? /* fail instantly if EOL is reached */
+				lwres_conf_parsenameserver(ctx, fp)
+				: LWRES_R_FAILURE;
 		else if (strcmp(word, "lwserver") == 0)
-			rval = lwres_conf_parselwserver(ctx, fp);
+			rval = (stopchar != '\n')?
+				lwres_conf_parselwserver(ctx, fp)
+				: LWRES_R_FAILURE;
 		else if (strcmp(word, "domain") == 0)
-			rval = lwres_conf_parsedomain(ctx, fp);
+			rval = (stopchar != '\n')?
+				lwres_conf_parsedomain(ctx, fp)
+				: LWRES_R_FAILURE;
 		else if (strcmp(word, "search") == 0)
-			rval = lwres_conf_parsesearch(ctx, fp);
+			rval = (stopchar != '\n')?
+				lwres_conf_parsesearch(ctx, fp)
+				: LWRES_R_FAILURE;
 		else if (strcmp(word, "sortlist") == 0)
-			rval = lwres_conf_parsesortlist(ctx, fp);
+			rval = (stopchar != '\n')?
+				lwres_conf_parsesortlist(ctx, fp)
+				: LWRES_R_FAILURE;
 		else if (strcmp(word, "options") == 0)
-			rval = lwres_conf_parseoption(ctx, fp);
+			rval = (stopchar != '\n')?
+				lwres_conf_parseoption(ctx, fp)
+				: LWRES_R_FAILURE;
 		else {
 			/* unrecognised word. Ignore entire line */
 			rval = LWRES_R_SUCCESS;
-			stopchar = eatline(fp);
-			if (stopchar == EOF) {
-				break;
+			if (stopchar != '\n') { /* do not eat the next line */
+				stopchar = eatline(fp);
+				if (stopchar == EOF) {
+					break;
+				}
 			}
 		}
 		if (ret == LWRES_R_SUCCESS && rval != LWRES_R_SUCCESS)






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-23 19:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-23 19:01 [gentoo-commits] gentoo-x86 commit in net-dns/bind-tools/files: bind-tools-9.5.0_p1-lwconfig.patch Tobias Scherbaum (dertobi123)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox