Per default we disable getrpcbyname and getrpcbynumber, if
this functions are available in libc. But with glibc, all
*rpcent* functions are using NSS, inside tirpc only /etc/rpc.
What happens now is that getrpcbyname/getrpcbynumber can return
other results as getrpcent. This should not happen. So check for
all functions if available from libc and don't use them if this
is the case.
Signed-off-by: Steve Dickson <steved@redhat.com>
AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h locale.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h features.h])
AC_CHECK_LIB([pthread], [pthread_create])
AC_CHECK_LIB([nsl], [yp_get_default_domain])
-AC_CHECK_FUNCS([getrpcbyname getrpcbynumber])
+AC_CHECK_FUNCS([getrpcbyname getrpcbynumber setrpcent endrpcent getrpcent])
AC_CONFIG_FILES([Makefile src/Makefile man/Makefile doc/Makefile])
AC_OUTPUT(libtirpc.pc)
#include <libc_private.h>
#endif
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#if !HAVE_GETRPCBYNAME || !HAVE_GETRPCBYNUMBER || \
+ !HAVE_SETRPCENT || !HAVE_ENDRPCENT || !HAVE_GETRPCENT
+
/*
* Internet version.
*/
}
#endif /* !HAVE_GETRPCBYNAME */
+#if !HAVE_SETRPCENT
void
setrpcent(f)
int f;
rewind(d->rpcf);
d->stayopen |= f;
}
+#endif
+#if !HAVE_ENDRPCENT
void
endrpcent()
{
d->rpcf = NULL;
}
}
+#endif
+#if !HAVE_GETRPCENT
struct rpcent *
getrpcent()
{
return (NULL);
return (interpret(d->line, strlen(d->line)));
}
+#endif
static struct rpcent *
interpret(val, len)
return (&d->rpc);
}
+#endif