about summary refs log tree commit diff
path: root/nis/nss_nisplus/nisplus-ethers.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-01-24 13:45:44 +0000
committerUlrich Drepper <drepper@redhat.com>1998-01-24 13:45:44 +0000
commitac9f45cfd18eeffd6a9fbbcc86e68657c95658a6 (patch)
treea36c5eed9258c2324f4f1b68f77217f83f2b4cf9 /nis/nss_nisplus/nisplus-ethers.c
parentecb9d3e182343fb4a89e4446e41037c6971b1657 (diff)
downloadglibc-ac9f45cfd18eeffd6a9fbbcc86e68657c95658a6.tar.gz
glibc-ac9f45cfd18eeffd6a9fbbcc86e68657c95658a6.tar.xz
glibc-ac9f45cfd18eeffd6a9fbbcc86e68657c95658a6.zip
Update NIS+.
1998-01-24  Thorsten Kukuk  <kukuk@vt.uni-paderborn.de>

	* nis/Makefile: Distribute nis_cache2.h, add nis cache functions
	to routines.
	* nis/nis_cache.c: New.
	* nis/nis_cache2.h: New.
	* nis/nis_cache2_xdr.c: New.
	* nis/nis_call.c: Changes for cache2_info parameter.
	* nis/nis_checkpoint.c: Likewise.
	* nis/nis_intern.h: Likewise.
	* nis/nis_mkdir.c: Likewise.
	* nis/nis_ping.c: Likewise.
	* nis/nis_rmdir.c: Likewise.
	* nis/nis_server.c: Likewise.
	* nis/nis_util.c: Likewise.

1997-12-30  Thorsten Kukuk  <kukuk@vt.uni-paderborn.de>

	* nis/nss_nisplus/nisplus-alias.c: Fix bogus if case and
	return/errnop codes.
	* nis/nss_nisplus/nisplus-ethers.c: Likewise.
	* nis/nss_nisplus/nisplus-grp.c: Likewise.
	* nis/nss_nisplus/nisplus-hosts.c: Likewise.
	* nis/nss_nisplus/nisplus-proto.c: Likewise.
	* nis/nss_nisplus/nisplus-publickey.c: Likewise.
	* nis/nss_nisplus/nisplus-pwd.c: Likewise.
	* nis/nss_nisplus/nisplus-rpc.c: Likewise
	* nis/nss_nisplus/nisplus-service.c: Likewise.
	* nis/nss_nisplus/nisplus-spwd.c: Likewise.

1997-12-28  Thorsten Kukuk  <kukuk@vt.uni-paderborn.de>

	* nis/nss_nis/nis-alias.c: Use errnop, not __set_errno().
	* nis/nss_nis/nis-ethers.c: Likewise.
	* nis/nss_nis/nis-grp.c: Likewise.
	* nis/nss_nis/nis-hosts.c: Likewise.
	* nis/nss_nis/nis-network.c: Likewise.
	* nis/nss_nis/nis-proto.c: Likewise.
	* nis/nss_nis/nis-hosts.c: Likewise.
	* nis/nss_nis/nis-network.c: Likewise.
	* nis/nss_nis/nis-proto.c: Likewise.
	* nis/nss_nis/nis-publickey.c: Likewise.
	* nis/nss_nis/nis-pwd.c: Likewise.
	* nis/nss_nis/nis-rpc.c: Likewise.
	* nis/nss_nis/nis-service.c: Likewise.
	* nis/nss_nis/nis-spwd.c: Likewise.
Diffstat (limited to 'nis/nss_nisplus/nisplus-ethers.c')
-rw-r--r--nis/nss_nisplus/nisplus-ethers.c41
1 files changed, 25 insertions, 16 deletions
diff --git a/nis/nss_nisplus/nisplus-ethers.c b/nis/nss_nisplus/nisplus-ethers.c
index 76805f1403..50f032a289 100644
--- a/nis/nss_nisplus/nisplus-ethers.c
+++ b/nis/nss_nisplus/nisplus-ethers.c
@@ -233,6 +233,11 @@ _nss_nisplus_gethostton_r (const char *name, struct etherent *eth,
 
   if (name != NULL)
     {
+      *errnop = EINVAL;
+      return NSS_STATUS_UNAVAIL;
+    }
+  else
+    {
       nis_result *result;
       char buf[strlen (name) + 40 + tablename_len];
 
@@ -249,17 +254,19 @@ _nss_nisplus_gethostton_r (const char *name, struct etherent *eth,
 
       parse_res = _nss_nisplus_parse_etherent (result, eth, buffer,
 					       buflen, errnop);
-      if (parse_res == -1)
+      if (parse_res < 1)
 	{
-	  nis_freeresult (result);
-	  *errnop = ERANGE;
-	  return NSS_STATUS_TRYAGAIN;
+	  if (parse_res == -1)
+	    {
+	      nis_freeresult (result);
+	      *errnop = ERANGE;
+	      return NSS_STATUS_TRYAGAIN;
+	    }
+	  else
+	   return NSS_STATUS_NOTFOUND;
 	}
-
-      if (parse_res)
-        return NSS_STATUS_SUCCESS;
+      return NSS_STATUS_SUCCESS;
     }
-  return NSS_STATUS_NOTFOUND;
 }
 
 enum nss_status
@@ -303,15 +310,17 @@ _nss_nisplus_getntohost_r (const struct ether_addr *addr,
 
       parse_res = _nss_nisplus_parse_etherent (result, eth, buffer,
 					       buflen, errnop);
-      if (parse_res == -1)
+      if (parse_res < 1)
 	{
-	  nis_freeresult (result);
-	  *errnop = ERANGE;
-	  return NSS_STATUS_TRYAGAIN;
+	  if (parse_res == -1)
+	    {
+	      nis_freeresult (result);
+	      *errnop = ERANGE;
+	      return NSS_STATUS_TRYAGAIN;
+	    }
+	  else
+	    return NSS_STATUS_NOTFOUND;
 	}
-
-      if (parse_res)
-	return NSS_STATUS_SUCCESS;
+      return NSS_STATUS_SUCCESS;
     }
-  return NSS_STATUS_NOTFOUND;
 }