+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.
+
1999-06-29 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* pwd/Makefile (tests): Add rules for tst-getpw.
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);
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
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);
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 {
hstbuflen = 1024;
hsttmpbuf = __alloca (hstbuflen);
while (__gethostbyname_r (*ahost, &hostbuf, hsttmpbuf, hstbuflen,
- &hp, &herr) != 0)
+ &hp, &herr) != 0
+ || hp == NULL)
if (herr != NETDB_INTERNAL || errno != ERANGE)
{
__set_h_errno (herr);
-/* Copyright (C) 1991, 92, 95, 96, 97, 98 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
#endif /* POSIX or reentrant */
+#ifdef __USE_GNU
+/* Re-construct the password-file line for the given uid
+ in the given buffer. This knows the format that the caller
+ will expect, but this need not be the format of the password file. */
+extern int getpw __P ((__uid_t __uid, char *__buffer));
+#endif
__END_DECLS
hstbuflen = 1024;
hsttmpbuf = __alloca (hstbuflen);
while (__gethostbyname_r (hostname, &hostbuf, hsttmpbuf, hstbuflen,
- &h, &herr) != 0)
+ &h, &herr) != 0
+ || h == NULL)
if (herr != NETDB_INTERNAL || errno != ERANGE)
{
rpc_createerr.cf_stat = RPC_UNKNOWNHOST;
prtbuflen = 1024;
prttmpbuf = __alloca (prtbuflen);
- while (__getprotobyname_r (proto, &protobuf, prttmpbuf, prtbuflen, &p) != 0)
+ while (__getprotobyname_r (proto, &protobuf, prttmpbuf, prtbuflen, &p) != 0
+ || p == NULL)
if (errno != ERANGE)
{
rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
buflen = 1024;
buffer = __alloca (buflen);
while (__gethostbyname_r (host, &hostbuf, buffer, buflen,
- &hp, &herr) != 0)
+ &hp, &herr) != 0
+ || hp == NULL)
if (herr != NETDB_INTERNAL || errno != ERANGE)
return (int) RPC_UNKNOWNHOST;
else
buflen = 1024;
buffer = __alloca (buflen);
- while (__gethostbyname_r (host, &hostbuf, buffer, buflen, &hp, &herr) != 0)
+ while (__gethostbyname_r (host, &hostbuf, buffer, buflen, &hp, &herr) != 0
+ || hp == NULL)
if (herr != NETDB_INTERNAL || errno != ERANGE)
return 0;
else
pwbuflen = 1024;
pwtmpbuf = (char *) __alloca (pwbuflen);
- success = 1;
while (getpwnam_r (name, &pwbuf, pwtmpbuf, pwbuflen, &p)
!= 0)
{
if (errno != ERANGE)
{
- success = 0;
+ p = NULL;
break;
}
pwbuflen *= 2;
}
# else
p = getpwnam (name);
- success = p != NULL;
# endif
- if (success)
+ if (p != NULL)
home_dir = p->pw_dir;
}
}
/* To get the IP address we need to know the host name. */
while (__gethostbyname_r (hostname, &hostbuf, buffer, buflen, &hp, &herr)
- != 0)
+ != 0
+ || hp == NULL)
if (herr != NETDB_INTERNAL || errno != ERANGE)
return 0;
else