diff --git a/.cvsignore b/.cvsignore index 360e2d7..8c99b93 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,3 +1,4 @@ libtirpc-0.1.7.tar.bz2 libtirpc-0.1.8.tar.bz2 libtirpc-0.1.9.tar.bz2 +libtirpc-0.1.10.tar.bz2 diff --git a/libtirpc-0.1.10-dg-unlock.patch b/libtirpc-0.1.10-dg-unlock.patch new file mode 100644 index 0000000..0babfeb --- /dev/null +++ b/libtirpc-0.1.10-dg-unlock.patch @@ -0,0 +1,29 @@ +commit 7c78a0362fcd3e0749330f11d0fdecb62131a6a3 +Author: Steve Dickson +Date: Thu Nov 20 08:53:52 2008 -0500 + + The clnt_fd_lock mutex lock was not being + released during an error path in clnt_dg_call. + + Signed-off-by: Steve Dickson + +diff --git a/src/clnt_dg.c b/src/clnt_dg.c +index da01c5b..9a574eb 100644 +--- a/src/clnt_dg.c ++++ b/src/clnt_dg.c +@@ -402,6 +402,7 @@ get_reply: + + fd.fd = cu->cu_fd; + fd.events = POLLIN; ++ fd.revents = 0; + while (total_time > 0) { + tv = total_time < nextsend_time ? total_time : nextsend_time; + switch (poll(&fd, 1, tv)) { +@@ -455,6 +456,7 @@ get_reply: + { + e = (struct sock_extended_err *) CMSG_DATA(cmsg); + cu->cu_error.re_errno = e->ee_errno; ++ release_fd_lock(cu->cu_fd, mask); + return (cu->cu_error.re_status = RPC_CANTRECV); + } + } diff --git a/libtirpc-0.1.10-errmess-unlock.patch b/libtirpc-0.1.10-errmess-unlock.patch new file mode 100644 index 0000000..72db05d --- /dev/null +++ b/libtirpc-0.1.10-errmess-unlock.patch @@ -0,0 +1,46 @@ +commit e145633cf10c92aa6f24b8a1a322435b4e874b02 +Author: Steve Dickson +Date: Thu Nov 20 08:55:31 2008 -0500 + + Changed clnt_spcreateerror() to return clearer + and more concise error messages. + + Signed-off-by: Steve Dickson + +diff --git a/src/clnt_perror.c b/src/clnt_perror.c +index 8f53f8e..1c1c705 100644 +--- a/src/clnt_perror.c ++++ b/src/clnt_perror.c +@@ -239,7 +239,7 @@ char * + clnt_spcreateerror(s) + const char *s; + { +- char *str; ++ char *str, *err; + size_t len, i; + + if (s == NULL) +@@ -257,8 +257,21 @@ clnt_spcreateerror(s) + switch (rpc_createerr.cf_stat) { + case RPC_PMAPFAILURE: + (void) strncat(str, " - ", len - 1); +- (void) strncat(str, +- clnt_sperrno(rpc_createerr.cf_error.re_status), len - 4); ++ err = clnt_sperrno(rpc_createerr.cf_error.re_status); ++ if (err) ++ (void) strncat(str, err+5, len-5); ++ switch(rpc_createerr.cf_error.re_status) { ++ case RPC_CANTSEND: ++ case RPC_CANTRECV: ++ i = strlen(str); ++ len -= i; ++ snprintf(str+i, len, ": errno %d (%s)", ++ rpc_createerr.cf_error.re_errno, ++ strerror(rpc_createerr.cf_error.re_errno)); ++ break; ++ default: ++ break; ++ } + break; + + case RPC_SYSTEMERROR: diff --git a/libtirpc-0.1.7-compile.patch b/libtirpc-0.1.7-compile.patch index 6c1d5a1..e4a72a1 100644 --- a/libtirpc-0.1.7-compile.patch +++ b/libtirpc-0.1.7-compile.patch @@ -4,8 +4,8 @@ lib_LTLIBRARIES = libtirpc.la --libtirpc_la_LDFLAGS = -lnsl -lpthread -version-info 1:8:0 -+libtirpc_la_LDFLAGS = -lnsl -lpthread -version-info 1:9:0 +-libtirpc_la_LDFLAGS = -lnsl -lpthread -version-info 1:9:0 ++libtirpc_la_LDFLAGS = -lnsl -lpthread -version-info 1:10:0 libtirpc_la_SOURCES = auth_none.c auth_unix.c authunix_prot.c bindresvport.c clnt_bcast.c \ clnt_dg.c clnt_generic.c clnt_perror.c clnt_raw.c clnt_simple.c \ diff --git a/libtirpc-0.1.7-taddr2uaddr-segflt.patch b/libtirpc-0.1.7-taddr2uaddr-segflt.patch deleted file mode 100644 index 15339b7..0000000 --- a/libtirpc-0.1.7-taddr2uaddr-segflt.patch +++ /dev/null @@ -1,25 +0,0 @@ -commit 338af7f9f00e096b65a6d823f885c4eeaf1d1f8c -Author: Steve Dickson -Date: Mon Oct 27 12:46:54 2008 -0400 - - __rpc_taddr2uaddr_af() assumes the netbuf to always have a - non-zero data. This is a bad assumption and can lead to a - seg-fault. This patch adds a check for zero length and returns - NULL when found. - - Signed-off-by: Steve Dickson - -diff --git a/src/rpc_generic.c b/src/rpc_generic.c -index 3aad018..27de254 100644 ---- a/src/rpc_generic.c -+++ b/src/rpc_generic.c -@@ -603,6 +603,9 @@ __rpc_taddr2uaddr_af(int af, const struct netbuf *nbuf) - #endif - u_int16_t port; - -+ if (nbuf->len <= 0) -+ return NULL; -+ - switch (af) { - case AF_INET: - sin = nbuf->buf; diff --git a/libtirpc-0.1.9-ipv6-socket.patch b/libtirpc-0.1.9-ipv6-socket.patch deleted file mode 100644 index 038d012..0000000 --- a/libtirpc-0.1.9-ipv6-socket.patch +++ /dev/null @@ -1,57 +0,0 @@ -commit ea9f048761d0b9a2ab6310bffa07351f0b04d8c5 -Author: Olaf Kirch -Date: Tue Sep 2 12:11:15 2008 -0400 - - Always make IPv6 sockets V6ONLY - - Assume you have a netconfig file looking like this: - - udp tpi_clts v inet udp - - - udp6 tpi_clts v inet6 udp - - - ... - - a call to svc_tli_create(... &someaddr, "udp") will fail to create an - IPv6 server socket. The problem is that on Linux, passive IPv6 sockets - will also accept packets/connections from IPv4, and will simply map - the sender's address to an IPv6 mapped IPv4 address. So if you want to - bind both a UDPv4 and UDPv6 socket to the same port, this will fail with - EADDRINUSE. - - The way to avoid this behavior is to change the socket to V6ONLY, - which tells the kernel to avoid the autmatic mapping. - - The change proposed in the patch below does this. I *think* this is - a good place to do this, as it will also fix applications that do not - use svc_tli_create() - such as rpcbind, which creates the sockets on - its own using __rpc_nconf2fd. - - I think this also improves portability, as BSD code assumes BSD - behavior, where this mapping does not occur either. - - Signed-off-by: Olaf Kirch - Signed-off-by: Steve Dickson - -diff --git a/src/rpc_generic.c b/src/rpc_generic.c -index 583aff0..ff4ba16 100644 ---- a/src/rpc_generic.c -+++ b/src/rpc_generic.c -@@ -525,11 +525,18 @@ int - __rpc_nconf2fd(const struct netconfig *nconf) - { - struct __rpc_sockinfo si; -+ int fd; - - if (!__rpc_nconf2sockinfo(nconf, &si)) - return 0; - -- return socket(si.si_af, si.si_socktype, si.si_proto); -+ if ((fd = socket(si.si_af, si.si_socktype, si.si_proto)) >= 0 && -+ si.si_af == AF_INET6) { -+ int val = 1; -+ -+ setsockopt(fd, SOL_IPV6, IPV6_V6ONLY, &val, sizeof(val)); -+ } -+ return fd; - } - - int diff --git a/libtirpc-0.1.9-rpc_getbroadifs-sizeof.patch b/libtirpc-0.1.9-rpc_getbroadifs-sizeof.patch deleted file mode 100644 index f8a3e53..0000000 --- a/libtirpc-0.1.9-rpc_getbroadifs-sizeof.patch +++ /dev/null @@ -1,27 +0,0 @@ -commit 95c8f7227e6b15f2e430d7b87dadc95b2acd4a61 -Author: Olaf Kirch -Date: Tue Sep 2 12:09:39 2008 -0400 - - Fix incorrect sizeof() in __rpc_getbroadifs - - __rpc_getbroadifs returns bad broadcast addresses on 32bit - machines because when copying the broadcast addresses, ite - applies the sizeof() operator to a pointer to a sockaddr, - rather than the sockaddr itself. - - Signed-off-by: Olaf Kirch - Signed-off-by: Steve Dickson - -diff --git a/src/clnt_bcast.c b/src/clnt_bcast.c -index a96db45..aa2b8f2 100644 ---- a/src/clnt_bcast.c -+++ b/src/clnt_bcast.c -@@ -163,7 +163,7 @@ __rpc_getbroadifs(int af, int proto, int socktype, broadlist_t *list) - /* memcpy(&bip->broadaddr, ifap->ifa_broadaddr, - (size_t)ifap->ifa_broadaddr->sa_len);*/ - memcpy(&bip->broadaddr, ifap->ifa_broadaddr, -- (size_t)sizeof(ifap->ifa_broadaddr)); -+ sizeof(bip->broadaddr)); - sin = (struct sockaddr_in *)(void *)&bip->broadaddr; - sin->sin_port = - ((struct sockaddr_in *) diff --git a/libtirpc-0.1.9-taddr2addr-typo.patch b/libtirpc-0.1.9-taddr2addr-typo.patch deleted file mode 100644 index 02557fe..0000000 --- a/libtirpc-0.1.9-taddr2addr-typo.patch +++ /dev/null @@ -1,27 +0,0 @@ -commit 9e7ba0c7a02031294fefadfbca42b3dd5f2d841f -Author: Olaf Kirch -Date: Tue Sep 16 08:46:29 2008 -0400 - - Fix for taddr2addr conversion bug of local addresses - - When converting af_local socket addresses in taddr2uaddr, an incorrect - sizeof() would result in a truncated path string. As a result, - rpcbind will report the local /var/lib/rpcbind address to clients - as "/v" on a 32bit machine. - - Signed-off-by: okir@suse.de - Signed-off-by: Steve Dickson - -diff --git a/src/rpc_generic.c b/src/rpc_generic.c -index ff4ba16..b436e3a 100644 ---- a/src/rpc_generic.c -+++ b/src/rpc_generic.c -@@ -629,7 +629,7 @@ __rpc_taddr2uaddr_af(int af, const struct netbuf *nbuf) - /* 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) - -+ if (asprintf(&ret, "%.*s", (int)(sizeof(*sun) - - offsetof(struct sockaddr_un, sun_path)), - sun->sun_path) < 0) - diff --git a/libtirpc-0.1.9-warnings-01.patch b/libtirpc-0.1.9-warnings-01.patch deleted file mode 100644 index 9e609b2..0000000 --- a/libtirpc-0.1.9-warnings-01.patch +++ /dev/null @@ -1,50 +0,0 @@ -commit 92cf0dde310ca341a2f29ff66b19eeb9994a649a -Author: Ian Kent -Date: Tue Oct 28 11:19:07 2008 -0400 - - Fixed a warings the IPV6 client routines - - Signed-off-by: Steve Dickson - -diff --git a/src/clnt_raw.c b/src/clnt_raw.c -index f184066..8b1650e 100644 ---- a/src/clnt_raw.c -+++ b/src/clnt_raw.c -@@ -165,7 +165,7 @@ call_again: - XDR_SETPOS(xdrs, 0); - clp->u.mashl_rpcmsg.rm_xid ++ ; - if ((! XDR_PUTBYTES(xdrs, clp->u.mashl_callmsg, clp->mcnt)) || -- (! XDR_PUTINT32(xdrs, &proc)) || -+ (! XDR_PUTINT32(xdrs, (int32_t *)&proc)) || - (! AUTH_MARSHALL(h->cl_auth, xdrs)) || - (! (*xargs)(xdrs, argsp))) { - return (RPC_CANTENCODEARGS); -diff --git a/src/clnt_vc.c b/src/clnt_vc.c -index 4ee6c20..1dcc976 100644 ---- a/src/clnt_vc.c -+++ b/src/clnt_vc.c -@@ -363,7 +363,7 @@ call_again: - x_id = ntohl(--(*msg_x_id)); - - if ((! XDR_PUTBYTES(xdrs, ct->ct_u.ct_mcallc, ct->ct_mpos)) || -- (! XDR_PUTINT32(xdrs, &proc)) || -+ (! XDR_PUTINT32(xdrs, (int32_t *)&proc)) || - (! AUTH_MARSHALL(cl->cl_auth, xdrs)) || - (! (*xdr_args)(xdrs, args_ptr))) { - if (ct->ct_error.re_status == RPC_SUCCESS) -diff --git a/tirpc/rpc/clnt_soc.h b/tirpc/rpc/clnt_soc.h -index f43d2ee..0f49a2e 100644 ---- a/tirpc/rpc/clnt_soc.h -+++ b/tirpc/rpc/clnt_soc.h -@@ -112,9 +112,9 @@ extern CLIENT *clntudp_create(struct sockaddr_in *, u_long, u_long, - extern CLIENT *clntudp_bufcreate(struct sockaddr_in *, u_long, u_long, - struct timeval, int *, u_int, u_int); - #ifdef INET6 --extern CLIENT *clntudp6_create(struct sockaddr_in *, u_long, u_long, -+extern CLIENT *clntudp6_create(struct sockaddr_in6 *, u_long, u_long, - struct timeval, int *); --extern CLIENT *clntudp6_bufcreate(struct sockaddr_in *, u_long, u_long, -+extern CLIENT *clntudp6_bufcreate(struct sockaddr_in6 *, u_long, u_long, - struct timeval, int *, u_int, u_int); - #endif - __END_DECLS diff --git a/libtirpc-0.1.9-warnings.patch b/libtirpc-0.1.9-warnings.patch deleted file mode 100644 index 5f046d3..0000000 --- a/libtirpc-0.1.9-warnings.patch +++ /dev/null @@ -1,145 +0,0 @@ -commit 628788c1cc84c86ee4cb36ee5d4fe8954e90fca5 -Author: Steve Dickson -Date: Tue Sep 16 11:32:31 2008 -0400 - - - Fixed some of warnings in: src/auth_time.c, src/clnt_dg.c and - src/clnt_raw.c - - Added some #ifdef NOTUSED around some code in src/rpbc_clnt.c - that was not being used... - - Signed-off-by: Steve Dickson - -diff --git a/src/auth_time.c b/src/auth_time.c -index d77bcf5..7cfbb7e 100644 ---- a/src/auth_time.c -+++ b/src/auth_time.c -@@ -248,7 +248,8 @@ __rpc_get_time_offset(td, srv, thost, uaddr, netid) - nis_server tsrv; - void (*oldsig)() = NULL; /* old alarm handler */ - struct sockaddr_in sin; -- int s = RPC_ANYSOCK, len; -+ int s = RPC_ANYSOCK; -+ socklen_t len; - int type = 0; - - td->tv_sec = 0; -diff --git a/src/clnt_dg.c b/src/clnt_dg.c -index 0e35742..da01c5b 100644 ---- a/src/clnt_dg.c -+++ b/src/clnt_dg.c -@@ -306,7 +306,7 @@ clnt_dg_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout) - int nrefreshes = 2; /* number of times to refresh cred */ - struct timeval timeout; - struct pollfd fd; -- int total_time, nextsend_time, tv; -+ int total_time, nextsend_time, tv=0; - struct sockaddr *sa; - sigset_t mask; - sigset_t newmask; -diff --git a/src/clnt_raw.c b/src/clnt_raw.c -index 36035c8..f184066 100644 ---- a/src/clnt_raw.c -+++ b/src/clnt_raw.c -@@ -84,8 +84,8 @@ clnt_raw_create(prog, vers) - { - struct clntraw_private *clp; - struct rpc_msg call_msg; -- XDR *xdrs = &clp->xdr_stream; -- CLIENT *client = &clp->client_object; -+ XDR *xdrs; -+ CLIENT *client; - - mutex_lock(&clntraw_lock); - clp = clntraw_private; -@@ -101,6 +101,8 @@ clnt_raw_create(prog, vers) - clp->_raw_buf = __rpc_rawcombuf; - clntraw_private = clp; - } -+ xdrs = &clp->xdr_stream; -+ client = &clp->client_object; - /* - * pre-serialize the static part of the call msg and stash it away - */ -diff --git a/src/rpbc_clnt.c b/src/rpbc_clnt.c -index 75811f0..0e25747 100644 ---- a/src/rpbc_clnt.c -+++ b/src/rpbc_clnt.c -@@ -109,7 +109,9 @@ static void delete_cache(struct netbuf *); - static void add_cache(const char *, const char *, struct netbuf *, char *); - static CLIENT *getclnthandle(const char *, const struct netconfig *, char **); - static CLIENT *local_rpcb(void); -+#if NOTUSED - static struct netbuf *got_entry(rpcb_entry_list_ptr, const struct netconfig *); -+#endif - - /* - * This routine adjusts the timeout used for calls to the remote rpcbind. -@@ -625,7 +627,7 @@ rpcb_unset(program, version, nconf) - CLNT_DESTROY(client); - return (rslt); - } -- -+#ifdef NOTUSED - /* - * From the merged list, find the appropriate entry - */ -@@ -657,7 +659,7 @@ got_entry(relp, nconf) - } - return (na); - } -- -+#endif - /* - * Quick check to see if rpcbind is up. Tries to connect over - * local transport. -@@ -725,7 +727,9 @@ __rpcb_findaddr_timed(program, version, nconf, host, clpp, tp) - CLIENT **clpp; - struct timeval *tp; - { -+#ifdef NOTUSED - static bool_t check_rpcbind = TRUE; -+#endif - CLIENT *client = NULL; - RPCB parms; - enum clnt_stat clnt_st; -diff --git a/src/rpcb_clnt.c b/src/rpcb_clnt.c -index 040f4ce..ed16f00 100644 ---- a/src/rpcb_clnt.c -+++ b/src/rpcb_clnt.c -@@ -109,7 +109,9 @@ static void delete_cache(struct netbuf *); - static void add_cache(const char *, const char *, struct netbuf *, char *); - static CLIENT *getclnthandle(const char *, const struct netconfig *, char **); - static CLIENT *local_rpcb(void); -+#ifdef NOTUSED - static struct netbuf *got_entry(rpcb_entry_list_ptr, const struct netconfig *); -+#endif - - /* - * This routine adjusts the timeout used for calls to the remote rpcbind. -@@ -625,7 +627,7 @@ rpcb_unset(program, version, nconf) - CLNT_DESTROY(client); - return (rslt); - } -- -+#ifdef NOTUSED - /* - * From the merged list, find the appropriate entry - */ -@@ -657,6 +659,7 @@ got_entry(relp, nconf) - } - return (na); - } -+#endif - - /* - * Quick check to see if rpcbind is up. Tries to connect over -@@ -725,7 +728,9 @@ __rpcb_findaddr_timed(program, version, nconf, host, clpp, tp) - CLIENT **clpp; - struct timeval *tp; - { -+#ifdef NOTUSED - static bool_t check_rpcbind = TRUE; -+#endif - CLIENT *client = NULL; - RPCB parms; - enum clnt_stat clnt_st; diff --git a/libtirpc.spec b/libtirpc.spec index bac7948..6801efd 100644 --- a/libtirpc.spec +++ b/libtirpc.spec @@ -1,6 +1,6 @@ Name: libtirpc -Version: 0.1.9 -Release: 7%{?dist} +Version: 0.1.10 +Release: 1%{?dist} Summary: Transport Independent RPC Library Group: System Environment/Libraries License: SISSL @@ -30,12 +30,8 @@ Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires(devel): pkgconfig man -Patch01: libtirpc-0.1.9-rpc_getbroadifs-sizeof.patch -Patch02: libtirpc-0.1.9-ipv6-socket.patch -Patch03: libtirpc-0.1.9-taddr2addr-typo.patch -Patch04: libtirpc-0.1.9-warnings.patch -Patch05: libtirpc-0.1.7-taddr2uaddr-segflt.patch -Patch06: libtirpc-0.1.9-warnings-01.patch +Patch01: libtirpc-0.1.10-dg-unlock.patch +Patch02: libtirpc-0.1.10-errmess-unlock.patch Patch100: libtirpc-0.1.7-compile.patch @@ -46,14 +42,7 @@ developing programs which use the tirpc library. %prep %setup -q -%patch01 -p1 -%patch02 -p1 -%patch03 -p1 -%patch04 -p1 -# 468014: rpcbind DoS in the taddr2uaddr XDR_DECODE -%patch05 -p1 -# 468815: Incorrect declaration in header file -%patch06 -p1 +%patch01 -p1 %patch100 -p1 @@ -152,10 +141,13 @@ rm -rf %{buildroot} %{_mandir}/*/* %changelog -* Tue Oct 28 2008 Steve Dickson 0.1.8-7 +* Thu Nov 20 2008 Steve Dickson 0.1.10-1 +- Updated to latest upstream version: 0.1.10 + +* Tue Oct 28 2008 Steve Dickson 0.1.9-7 - Fixed some incorrect function declarations (bz468815) -* Mon Oct 27 2008 Steve Dickson 0.1.8-6 +* Mon Oct 27 2008 Steve Dickson 0.1.9-6 - Fix bad assumption taddr2uaddr processing that caused a segfault (bz468014) diff --git a/sources b/sources index 2762c0f..ad78bcf 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ee8b0aecadc45e00a2fd654f178c6247 libtirpc-0.1.9.tar.bz2 +4192ad1c683abb7eb2ca77d5fd64e54b libtirpc-0.1.10.tar.bz2