summary refs log tree commit diff
path: root/inet/rcmd.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-06-30 17:41:35 +0000
committerUlrich Drepper <drepper@redhat.com>1999-06-30 17:41:35 +0000
commit1d863dc0b41da22b5a06110d67b47a0f102cb639 (patch)
tree3570b4ace8356ad2e0dd2ce8ab2edb900257203d /inet/rcmd.c
parentc11f120913b8c6a6be67ddf3dc36a3d239f2f322 (diff)
downloadglibc-1d863dc0b41da22b5a06110d67b47a0f102cb639.tar.gz
glibc-1d863dc0b41da22b5a06110d67b47a0f102cb639.tar.xz
glibc-1d863dc0b41da22b5a06110d67b47a0f102cb639.zip
Update.
1999-06-30  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysv/linux/gethostid.c: Handle failing call to
	getxxbyYY_r functions correctly for non-existing entry.
	* sunrpc/getrpcport.c: Likewise.
	* sunrpc/clnt_simp.c: Likewise.
	* inet/rexec.c: Likewise.
	* sunrpc/clnt_gen.c: Likewise.
	* inet/rcmd.c: Likewise.
	* sysdeps/generic/glob.c: Likewise.
Diffstat (limited to 'inet/rcmd.c')
-rw-r--r--inet/rcmd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/inet/rcmd.c b/inet/rcmd.c
index 923f21fe40..30f20d1922 100644
--- a/inet/rcmd.c
+++ b/inet/rcmd.c
@@ -80,7 +80,8 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
 	hstbuflen = 1024;
 	tmphstbuf = __alloca (hstbuflen);
 	while (__gethostbyname_r (*ahost, &hostbuf, tmphstbuf, hstbuflen,
-				  &hp, &herr) != 0)
+				  &hp, &herr) != 0
+	       || hp == NULL)
 	  if (herr != NETDB_INTERNAL || errno != ERANGE)
 	    {
 	      __set_h_errno (herr);
@@ -270,7 +271,8 @@ ruserok(rhost, superuser, ruser, luser)
 	buffer = __alloca (buflen);
 
 	while (__gethostbyname_r (rhost, &hostbuf, buffer, buflen, &hp, &herr)
-	       != 0)
+	       != 0
+	       || hp == NULL)
 	  if (herr != NETDB_INTERNAL || errno != ERANGE)
 	    return -1;
 	  else
@@ -370,7 +372,8 @@ iruserok2 (raddr, superuser, ruser, luser, rhost)
       char *buffer = __alloca (buflen);
       uid_t uid;
 
-      if (__getpwnam_r (luser, &pwdbuf, buffer, buflen, &pwd))
+      if (__getpwnam_r (luser, &pwdbuf, buffer, buflen, &pwd) != 0
+	  || pwd == NULL)
 	return -1;
 
       dirlen = strlen (pwd->pw_dir);
@@ -469,7 +472,8 @@ __icheckhost (raddr, lhost, rhost)
 	buffer = __alloca (buflen);
 	save_errno = errno;
 	while (__gethostbyname_r (lhost, &hostbuf, buffer, buflen, &hp, &herr)
-	       != 0)
+	       != 0
+	       || hp = NULL)
 		if (herr != NETDB_INTERNAL || errno != ERANGE)
 			return (0);
 		else {