about summary refs log tree commit diff
path: root/nss
diff options
context:
space:
mode:
Diffstat (limited to 'nss')
-rw-r--r--nss/Makefile3
-rw-r--r--nss/nss_dns/dns-host.c11
-rw-r--r--nss/nss_files/files-netgrp.c5
3 files changed, 11 insertions, 8 deletions
diff --git a/nss/Makefile b/nss/Makefile
index 319bad5b29..a921bb7fdf 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -55,7 +55,8 @@ libnss_dns-routines	:= dns-host dns-network
 
 libnss_db-routines	:= $(addprefix db-,$(filter-out hosts network,\
 							$(databases)))
-generated		+= $(addsuffix .c,$(libnss_db-routines))
+generated		+= $(filter-out db-netgrp.c, \
+					$(addsuffix .c,$(libnss_db-routines)))
 distribute		+= db-XXX.c
 
 libnss_files-inhibit-o	= $(filter-out .so,$(object-suffixes))
diff --git a/nss/nss_dns/dns-host.c b/nss/nss_dns/dns-host.c
index f8d5d37e72..120923069c 100644
--- a/nss/nss_dns/dns-host.c
+++ b/nss/nss_dns/dns-host.c
@@ -589,15 +589,12 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
 	      cp += n;
 	      continue;			/* XXX - had_error++ ? */
 	    }
-	  if (haveanswer)
+	  if (n != result->h_length)
 	    {
-	      if (n != result->h_length)
-		{
-		  cp += n;
-		  continue;
-		}
+	      cp += n;
+	      continue;
 	    }
-	  else
+	  if (!haveanswer)
 	    {
 	      register int nn;
 
diff --git a/nss/nss_files/files-netgrp.c b/nss/nss_files/files-netgrp.c
index c653825c78..427c6bfe8d 100644
--- a/nss/nss_files/files-netgrp.c
+++ b/nss/nss_files/files-netgrp.c
@@ -188,6 +188,11 @@ _nss_netgroup_parseline (char **cursor, struct __netgrent *result,
   const char *host, *user, *domain;
   char *cp = *cursor;
 
+  /* Some sanity checks.  */
+  if (cp == NULL)
+    /* User bug.  setnetgrent() wasn't called before.  */
+    abort ();
+
   /* First skip leading spaces.  */
   while (isspace (*cp))
     ++cp;