From 2977588de04fac88cac404e2515291dcac7e8aee Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Tue, 16 Dec 2014 14:35:20 -0500 Subject: [PATCH] Update to latest RC release: libtirpc-0-2-6-rc Signed-off-by: Steve Dickson --- libtirpc-0.2.6-rc2.patch | 270 +++++++++++++++++++++++++++++++++++++++ libtirpc.spec | 11 +- 2 files changed, 277 insertions(+), 4 deletions(-) create mode 100644 libtirpc-0.2.6-rc2.patch diff --git a/libtirpc-0.2.6-rc2.patch b/libtirpc-0.2.6-rc2.patch new file mode 100644 index 0000000..bbb2cbd --- /dev/null +++ b/libtirpc-0.2.6-rc2.patch @@ -0,0 +1,270 @@ +diff --git a/INSTALL b/INSTALL +index 8b641e3..f812f5a 120000 +--- a/INSTALL ++++ b/INSTALL +@@ -1 +1 @@ +-/usr/share/automake-1.13/INSTALL +\ No newline at end of file ++/usr/share/automake-1.14/INSTALL +\ No newline at end of file +diff --git a/configure.ac b/configure.ac +index bcbe911..10d17ea 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1,4 +1,4 @@ +-AC_INIT(libtirpc, 0.2.5) ++AC_INIT(libtirpc, 0.2.4) + AM_INIT_AUTOMAKE([silent-rules]) + AM_SILENT_RULES([yes]) + AC_CONFIG_SRCDIR([src/auth_des.c]) +diff --git a/libtirpc.pc.in b/libtirpc.pc.in +index ec4cf75..38034c5 100644 +--- a/libtirpc.pc.in ++++ b/libtirpc.pc.in +@@ -8,4 +8,5 @@ Description: Transport Independent RPC Library + Requires: + Version: @PACKAGE_VERSION@ + Libs: -L@libdir@ -ltirpc ++Libs.private: -lpthread + Cflags: -I@includedir@/tirpc +diff --git a/src/clnt_bcast.c b/src/clnt_bcast.c +index 373d8a5..ddcb694 100644 +--- a/src/clnt_bcast.c ++++ b/src/clnt_bcast.c +@@ -142,7 +142,8 @@ __rpc_getbroadifs(int af, int proto, int socktype, broadlist_t *list) + return 0; + + for (ifap = ifp; ifap != NULL; ifap = ifap->ifa_next) { +- if (ifap->ifa_addr->sa_family != af || ++ if (ifap->ifa_addr == NULL || /* happens for eg tuntap devices */ ++ ifap->ifa_addr->sa_family != af || + !(ifap->ifa_flags & IFF_UP)) + continue; + bip = (struct broadif *)malloc(sizeof *bip); +@@ -588,9 +589,11 @@ rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp, + LIBTIRPC_DEBUG(3, ("rpc_broadcast_exp: uaddr %s\n", uaddrp)); + np = uaddr2taddr( + fdlist[i].nconf, uaddrp); +- done = (*eachresult)(resultsp, +- np, fdlist[i].nconf); +- free(np); ++ if (np != NULL) { ++ done = (*eachresult)(resultsp, ++ np, fdlist[i].nconf); ++ free(np); ++ } + #ifdef PORTMAP + } + #endif /* PORTMAP */ +diff --git a/src/debug.h b/src/debug.h +index afc8d57..c971ac3 100644 +--- a/src/debug.h ++++ b/src/debug.h +@@ -21,6 +21,8 @@ + + #ifndef _DEBUG_H + #define _DEBUG_H ++ ++#include + #include + + extern int libtirpc_debug_level; +diff --git a/src/rpc_generic.c b/src/rpc_generic.c +index a43906c..764a25c 100644 +--- a/src/rpc_generic.c ++++ b/src/rpc_generic.c +@@ -608,6 +608,7 @@ __rpc_taddr2uaddr_af(int af, const struct netbuf *nbuf) + struct sockaddr_in6 *sin6; + char namebuf6[INET6_ADDRSTRLEN]; + #endif ++ int path_len; + u_int16_t port; + + if (nbuf->len <= 0) +@@ -638,13 +639,12 @@ __rpc_taddr2uaddr_af(int af, const struct netbuf *nbuf) + #endif + case AF_LOCAL: + sun = nbuf->buf; +- /* if (asprintf(&ret, "%.*s", (int)(sun->sun_len - +- offsetof(struct sockaddr_un, sun_path)), +- sun->sun_path) < 0)*/ +- if (asprintf(&ret, "%.*s", (int)(sizeof(*sun) - +- offsetof(struct sockaddr_un, sun_path)), +- sun->sun_path) < 0) + ++ path_len = nbuf->len - offsetof(struct sockaddr_un, sun_path); ++ if (path_len < 0) ++ return NULL; ++ ++ if (asprintf(&ret, "%.*s", path_len, sun->sun_path) < 0) + return (NULL); + break; + default: +diff --git a/src/rpc_soc.c b/src/rpc_soc.c +index 338edbb..e146ed4 100644 +--- a/src/rpc_soc.c ++++ b/src/rpc_soc.c +@@ -564,16 +564,12 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz) + u_int sendsz; + u_int recvsz; + { +- struct netbuf *svcaddr; +- CLIENT *cl; ++ struct netbuf svcaddr = {0, 0, NULL}; ++ CLIENT *cl = NULL; + int len; + +- cl = NULL; +- svcaddr = NULL; +- if (((svcaddr = malloc(sizeof(struct netbuf))) == NULL ) || +- ((svcaddr->buf = malloc(sizeof(struct sockaddr_un))) == NULL)) { +- if (svcaddr != NULL) +- free(svcaddr); ++ memset(&svcaddr, 0, sizeof(svcaddr)); ++ if (__rpc_set_netbuf(&svcaddr, raddr, sizeof(*raddr)) == NULL) { + rpc_createerr.cf_stat = RPC_SYSTEMERROR; + rpc_createerr.cf_error.re_errno = errno; + return(cl); +@@ -590,14 +586,10 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz) + goto done; + } + } +- svcaddr->buf = raddr; +- svcaddr->len = sizeof(raddr); +- svcaddr->maxlen = sizeof (struct sockaddr_un); +- cl = clnt_vc_create(*sockp, svcaddr, prog, ++ cl = clnt_vc_create(*sockp, &svcaddr, prog, + vers, sendsz, recvsz); + done: +- free(svcaddr->buf); +- free(svcaddr); ++ free(svcaddr.buf); + return(cl); + } + +diff --git a/src/rpcb_clnt.c b/src/rpcb_clnt.c +index a796593..f1c71a2 100644 +--- a/src/rpcb_clnt.c ++++ b/src/rpcb_clnt.c +@@ -401,6 +401,44 @@ out_err: + return (client); + } + ++/* ++ * Create a PMAP client handle. ++ */ ++static CLIENT * ++getpmaphandle(nconf, hostname, tgtaddr) ++ const struct netconfig *nconf; ++ const char *hostname; ++ char **tgtaddr; ++{ ++ CLIENT *client = NULL; ++ rpcvers_t pmapvers = 2; ++ ++ /* ++ * Try UDP only - there are some portmappers out ++ * there that use UDP only. ++ */ ++ if (nconf == NULL || strcmp(nconf->nc_proto, NC_TCP) == 0) { ++ struct netconfig *newnconf; ++ ++ if ((newnconf = getnetconfigent("udp")) == NULL) { ++ rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; ++ return NULL; ++ } ++ client = getclnthandle(hostname, newnconf, tgtaddr); ++ freenetconfigent(newnconf); ++ } else if (strcmp(nconf->nc_proto, NC_UDP) == 0) { ++ if (strcmp(nconf->nc_protofmly, NC_INET) != 0) ++ return NULL; ++ client = getclnthandle(hostname, nconf, tgtaddr); ++ } ++ ++ /* Set version */ ++ if (client != NULL) ++ CLNT_CONTROL(client, CLSET_VERS, (char *)&pmapvers); ++ ++ return client; ++} ++ + /* XXX */ + #define IN4_LOCALHOST_STRING "127.0.0.1" + #define IN6_LOCALHOST_STRING "::1" +@@ -733,34 +771,20 @@ __rpcb_findaddr_timed(program, version, nconf, host, clpp, tp) + if (strcmp(nconf->nc_protofmly, NC_INET) == 0) { + u_short port = 0; + struct netbuf remote; +- rpcvers_t pmapvers = 2; + struct pmap pmapparms; + +- /* +- * Try UDP only - there are some portmappers out +- * there that use UDP only. +- */ +- if (strcmp(nconf->nc_proto, NC_TCP) == 0) { +- struct netconfig *newnconf; +- +- if ((newnconf = getnetconfigent("udp")) == NULL) { +- rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; +- return (NULL); +- } +- client = getclnthandle(host, newnconf, &parms.r_addr); +- freenetconfigent(newnconf); +- } else if (strcmp(nconf->nc_proto, NC_UDP) == 0) +- client = getclnthandle(host, nconf, &parms.r_addr); +- else ++ if (strcmp(nconf->nc_proto, NC_UDP) != 0 ++ && strcmp(nconf->nc_proto, NC_TCP) != 0) + goto try_rpcbind; ++ ++ client = getpmaphandle(nconf, host, &parms.r_addr); + if (client == NULL) + return (NULL); + + /* +- * Set version and retry timeout. ++ * Set retry timeout. + */ + CLNT_CONTROL(client, CLSET_RETRY_TIMEOUT, (char *)&rpcbrmttime); +- CLNT_CONTROL(client, CLSET_VERS, (char *)&pmapvers); + + pmapparms.pm_prog = program; + pmapparms.pm_vers = version; +diff --git a/src/svc_vc.c b/src/svc_vc.c +index 4c70de8..4d3ea51 100644 +--- a/src/svc_vc.c ++++ b/src/svc_vc.c +@@ -559,20 +559,19 @@ write_vc(xprtp, buf, len) + cd->strm_stat = XPRT_DIED; + return (-1); + } +- if (cd->nonblock && i != cnt) { +- /* +- * For non-blocking connections, do not +- * take more than 2 seconds writing the +- * data out. +- * +- * XXX 2 is an arbitrary amount. +- */ +- gettimeofday(&tv1, NULL); +- if (tv1.tv_sec - tv0.tv_sec >= 2) { +- cd->strm_stat = XPRT_DIED; +- return (-1); +- } ++ /* ++ * For non-blocking connections, do not ++ * take more than 2 seconds writing the ++ * data out. ++ * ++ * XXX 2 is an arbitrary amount. ++ */ ++ gettimeofday(&tv1, NULL); ++ if (tv1.tv_sec - tv0.tv_sec >= 2) { ++ cd->strm_stat = XPRT_DIED; ++ return (-1); + } ++ i = 0; /* Don't change buf and cnt */ + } + } + diff --git a/libtirpc.spec b/libtirpc.spec index 4eb93a4..db3703b 100644 --- a/libtirpc.spec +++ b/libtirpc.spec @@ -2,7 +2,7 @@ Name: libtirpc Version: 0.2.5 -Release: 2%{?dist} +Release: 2.1%{?dist} Summary: Transport Independent RPC Library Group: System Environment/Libraries License: SISSL and BSD @@ -10,7 +10,7 @@ URL: http://nfsv4.bullopensource.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Source0: http://downloads.sourceforge.net/libtirpc/libtirpc-%{version}.tar.bz2 -Patch001: libtirpc-0.2.6-rc1.patch +Patch001: libtirpc-0.2.6-rc2.patch BuildRequires: automake, autoconf, libtool, pkgconfig BuildRequires: krb5-devel @@ -132,9 +132,12 @@ rm -rf %{buildroot} %{_mandir}/*/* %changelog -* Tue Dec 16 2014 Tom Callaway 0.2.5-2 +* Tue Dec 16 2014 Tom Callaway 0.2.5-2.1 - minor spec cleanups, add license texts +- Tue Dec 16 2014 Steve Dickson 0.2.5-1.0 +- Update to latest RC release: libtirpc-0-2-6-rc2 + * Tue Nov 11 2014 Steve Dickson 0.2.5-1.0 - Update to latest RC release: libtirpc-0-2-6-rc1 (bz 1162711) @@ -299,7 +302,7 @@ rm -rf %{buildroot} * Thu Aug 7 2008 Tom "spot" Callaway 0.1.9-3 - fix license tag -* Tue Jul 9 2008 Steve Dickson 0.1.9-1 +* Tue Jul 8 2008 Steve Dickson 0.1.9-1 - Update to latest upstream version 0.1.9 * Fri Jun 27 2008 Steve Dickson 0.1.8-2