Update to latest upstream version 0.1.8

This commit is contained in:
Steve Dickson 2008-06-10 19:42:19 +00:00
parent b94287a679
commit 812e01bc08
19 changed files with 12 additions and 738 deletions

View File

@ -1 +1,2 @@
libtirpc-0.1.7.tar.bz2
libtirpc-0.1.8.tar.bz2

View File

@ -1,23 +0,0 @@
commit 3f947c093f828629c2fc5624aa3ad8c7465f76d1
Author: Steve Dickson <steved@redhat.com>
Date: Thu Oct 25 10:55:57 2007 -0400
Added " || defined(__arm__)" to xdr_float.c which allows libtirpc
to build on ARM processors.
Author-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Steve Dickson <steved@redhat.com>
diff --git a/src/xdr_float.c b/src/xdr_float.c
index 375e535..d8b22e6 100644
--- a/src/xdr_float.c
+++ b/src/xdr_float.c
@@ -59,7 +59,7 @@
defined(__mips__) || defined(__ns32k__) || defined(__alpha__) || \
defined(__arm32__) || defined(__ppc__) || defined(__ia64__) || \
defined(__arm26__) || defined(__sparc64__) || defined(__amd64__) || \
- defined(__powerpc__) || defined(__s390__)
+ defined(__powerpc__) || defined(__s390__) || defined(__arm__)
#include <bits/endian.h>
#define IEEEFP
#endif

View File

@ -1,29 +0,0 @@
commit 83cb8b02f87fe6fd7bbd903e4825f7cb38e59ec4
Author: Steve Dickson <steved@redhat.com>
Date: Fri May 4 12:19:27 2007 -0400
A couple ntohs() were needed in bindresvport_sa()
Signed-off-by: Steve Dickson <steved@redhat.com>
diff --git a/src/bindresvport.c b/src/bindresvport.c
index bc75d29..6aac03c 100644
--- a/src/bindresvport.c
+++ b/src/bindresvport.c
@@ -101,14 +101,14 @@ bindresvport_sa(sd, sa)
case AF_INET:
sin = (struct sockaddr_in *)sa;
salen = sizeof(struct sockaddr_in);
- port = sin->sin_port;
+ port = ntohs(sin->sin_port);
portp = &sin->sin_port;
break;
#ifdef INET6
case AF_INET6:
sin6 = (struct sockaddr_in6 *)sa;
salen = sizeof(struct sockaddr_in6);
- port = sin6->sin6_port;
+ port = ntohs(sin6->sin6_port);
portp = &sin6->sin6_port;
break;
#endif

View File

@ -1,64 +0,0 @@
commit c254b435007ebd4ed471737198975d5ccf4e7949
Author: Steve Dickson <steved@redhat.com>
Date: Thu Apr 26 17:20:21 2007 -0400
Added a optimization to bindresvport that allows more
ports to be tried.
Signed-off-by: Steve Dickson <steved@redhat.com>
diff --git a/src/bindresvport.c b/src/bindresvport.c
index b197efa..bc75d29 100644
--- a/src/bindresvport.c
+++ b/src/bindresvport.c
@@ -62,6 +62,7 @@ bindresvport(sd, sin)
#ifdef __linux__
#define STARTPORT 600
+#define LOWPORT 512
#define ENDPORT (IPPORT_RESERVED - 1)
#define NPORTS (ENDPORT - STARTPORT + 1)
@@ -76,10 +77,13 @@ bindresvport_sa(sd, sa)
#ifdef INET6
struct sockaddr_in6 *sin6;
#endif
- u_int16_t port;
u_int16_t *portp;
+ static u_int16_t port;
+ static short startport = STARTPORT;
socklen_t salen;
- int i;
+ int nports = ENDPORT - startport + 1;
+ int endport = ENDPORT;
+ int i;
if (sa == NULL) {
salen = sizeof(myaddr);
@@ -119,13 +123,22 @@ bindresvport_sa(sd, sa)
}
res = -1;
errno = EADDRINUSE;
- for (i = 0; i < NPORTS && res < 0 && errno == EADDRINUSE; i++) {
+ again:
+ for (i = 0; i < nports; ++i) {
*portp = htons(port++);
- if (port > ENDPORT) {
- port = STARTPORT;
- }
+ if (port > endport)
+ port = startport;
res = bind(sd, sa, salen);
+ if (res >= 0 || errno != EADDRINUSE)
+ break;
}
+ if (i == nports && startport != LOWPORT) {
+ startport = LOWPORT;
+ endport = STARTPORT - 1;
+ nports = STARTPORT - LOWPORT;
+ port = LOWPORT + port % (STARTPORT - LOWPORT);
+ goto again;
+ }
return (res);
}
#else

View File

@ -1,35 +0,0 @@
commit 3cf1a3ce1a409e647f9b8ca4497c26e6d066f293
Author: Steve Dickson <steved@redhat.com>
Date: Thu Jan 24 15:01:22 2008 -0500
Protect from buffer overflow in the GSS code.
Signed-off-by: Steve Dickson <steved@redhat.com>
diff -up libtirpc-0.1.7/src/svc_auth_gss.c.orig libtirpc-0.1.7/src/svc_auth_gss.c
--- libtirpc-0.1.7/src/svc_auth_gss.c.orig 2008-01-24 14:41:21.000000000 -0500
+++ libtirpc-0.1.7/src/svc_auth_gss.c 2008-01-24 14:59:31.000000000 -0500
@@ -294,6 +294,15 @@ svcauth_gss_validate(struct svc_rpc_gss_
memset(rpchdr, 0, sizeof(rpchdr));
/* XXX - Reconstruct RPC header for signing (from xdr_callmsg). */
+ oa = &msg->rm_call.cb_cred;
+ if (oa->oa_length > MAX_AUTH_BYTES)
+ return (FALSE);
+
+ /* 8 XDR units from the IXDR macro calls. */
+ if (sizeof(rpchdr) < (8 * BYTES_PER_XDR_UNIT +
+ RNDUP(oa->oa_length)))
+ return (FALSE);
+
buf = (int32_t *)rpchdr;
IXDR_PUT_LONG(buf, msg->rm_xid);
IXDR_PUT_ENUM(buf, msg->rm_direction);
@@ -301,7 +310,6 @@ svcauth_gss_validate(struct svc_rpc_gss_
IXDR_PUT_LONG(buf, msg->rm_call.cb_prog);
IXDR_PUT_LONG(buf, msg->rm_call.cb_vers);
IXDR_PUT_LONG(buf, msg->rm_call.cb_proc);
- oa = &msg->rm_call.cb_cred;
IXDR_PUT_ENUM(buf, oa->oa_flavor);
IXDR_PUT_LONG(buf, oa->oa_length);
if (oa->oa_length) {

View File

@ -1,28 +0,0 @@
commit 419d35db75ab8bd8f79c424f529a6c2f7c4f5fa7
Author: Steve Dickson <steved@redhat.com>
Date: Fri May 4 09:27:00 2007 -0400
Fixed mutex locking problem in clnt_raw.c. One should grab the
clntraw_lock before accessing at clntraw_private, not after.
Signed-off-by: Steve Dickson <steved@redhat.com>
diff --git a/src/clnt_raw.c b/src/clnt_raw.c
index 153dd87..36035c8 100644
--- a/src/clnt_raw.c
+++ b/src/clnt_raw.c
@@ -82,12 +82,13 @@ clnt_raw_create(prog, vers)
rpcprog_t prog;
rpcvers_t vers;
{
- struct clntraw_private *clp = clntraw_private;
+ struct clntraw_private *clp;
struct rpc_msg call_msg;
XDR *xdrs = &clp->xdr_stream;
CLIENT *client = &clp->client_object;
mutex_lock(&clntraw_lock);
+ clp = clntraw_private;
if (clp == NULL) {
clp = (struct clntraw_private *)calloc(1, sizeof (*clp));
if (clp == NULL) {

View File

@ -5,32 +5,10 @@
lib_LTLIBRARIES = libtirpc.la
-libtirpc_la_LDFLAGS = -lnsl -lpthread
+libtirpc_la_LDFLAGS = -lnsl -lpthread -version-info 1:7:0
+libtirpc_la_LDFLAGS = -lnsl -lpthread -version-info 1:8: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 \
--- libtirpc-0.1.7/src/svc_auth_gss.c.orig 2005-05-18 01:10:50.000000000 -0400
+++ libtirpc-0.1.7/src/svc_auth_gss.c 2006-08-09 15:15:31.000000000 -0400
@@ -382,7 +382,7 @@ _svcauth_gss(struct svc_req *rqst, struc
return (AUTH_FAILED);
}
auth->svc_ah_ops = &svc_auth_gss_ops;
- SVCAUTH_PRIVATE(auth) = gd;
+ auth->svc_ah_private = (caddr_t) gd;
rqst->rq_xprt->xp_auth = auth;
}
else gd = SVCAUTH_PRIVATE(rqst->rq_xprt->xp_auth);
--- libtirpc-0.1.7/configure.in.orig 2005-05-18 01:10:50.000000000 -0400
+++ libtirpc-0.1.7/configure.in 2006-08-09 15:15:31.000000000 -0400
@@ -1,6 +1,6 @@
-AC_INIT(libtirpc, 0.1.5)
-AM_INIT_AUTOMAKE(libtirpc, 0.1.5)
+AC_INIT(libtirpc, 0.1.7)
+AM_INIT_AUTOMAKE(libtirpc, 0.1.7)
AM_MAINTAINER_MODE
AC_CONFIG_SRCDIR([src/auth_des.c])
--- libtirpc-0.1.7/Makefile.am.orig 2005-05-18 01:10:50.000000000 -0400
+++ libtirpc-0.1.7/Makefile.am 2006-08-09 15:15:31.000000000 -0400
@@ -44,5 +44,5 @@ nobase_include_HEADERS = tirpc/un-namesp

View File

@ -1,98 +0,0 @@
commit 40ab0c28e995786d5844bd490a31b788ecabf546
Author: Steve Dickson <steved@redhat.com>
Date: Fri May 4 14:26:56 2007 -0400
Added IP_RECVERR processing with to clnt_dg_call() so
application will see errors instead of timing out
Signed-off-by: Steve Dickson <steved@redhat.com>
diff --git a/src/clnt_dg.c b/src/clnt_dg.c
index 151b449..0e35742 100644
--- a/src/clnt_dg.c
+++ b/src/clnt_dg.c
@@ -55,6 +55,13 @@
#include <err.h>
#include "rpc_com.h"
+#ifdef IP_RECVERR
+#include <asm/types.h>
+#include <linux/errqueue.h>
+#include <sys/uio.h>
+#endif
+
+
#define MAX_DEFAULT_FDS 20000
static struct clnt_ops *clnt_dg_ops(void);
@@ -246,6 +253,12 @@ clnt_dg_create(fd, svcaddr, program, version, sendsz, recvsz)
#if 0
(void)bindresvport_sa(fd, (struct sockaddr *)svcaddr->buf);
#endif
+#ifdef IP_RECVERR
+ {
+ int on = 1;
+ setsockopt(fd, SOL_IP, IP_RECVERR, &on, sizeof(on));
+ }
+#endif
ioctl(fd, FIONBIO, (char *)(void *)&one);
/*
* By default, closeit is always FALSE. It is users responsibility
@@ -352,7 +365,7 @@ call_again:
xid++;
*(u_int32_t *)(void *)(cu->cu_outbuf) = htonl(xid);
- if ((! XDR_PUTINT32(xdrs, &proc)) ||
+ if ((! XDR_PUTINT32(xdrs, (int32_t *)&proc)) ||
(! AUTH_MARSHALL(cl->cl_auth, xdrs)) ||
(! (*xargs)(xdrs, argsp))) {
cu->cu_error.re_status = RPC_CANTENCODEARGS;
@@ -404,6 +417,48 @@ get_reply:
}
break;
}
+#ifdef IP_RECVERR
+ if (fd.revents & POLLERR)
+ {
+ struct msghdr msg;
+ struct cmsghdr *cmsg;
+ struct sock_extended_err *e;
+ struct sockaddr_in err_addr;
+ struct sockaddr_in *sin = (struct sockaddr_in *)&cu->cu_raddr;
+ struct iovec iov;
+ char *cbuf = (char *) alloca (outlen + 256);
+ int ret;
+
+ iov.iov_base = cbuf + 256;
+ iov.iov_len = outlen;
+ msg.msg_name = (void *) &err_addr;
+ msg.msg_namelen = sizeof (err_addr);
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
+ msg.msg_flags = 0;
+ msg.msg_control = cbuf;
+ msg.msg_controllen = 256;
+ ret = recvmsg (cu->cu_fd, &msg, MSG_ERRQUEUE);
+ if (ret >= 0
+ && memcmp (cbuf + 256, cu->cu_outbuf, ret) == 0
+ && (msg.msg_flags & MSG_ERRQUEUE)
+ && ((msg.msg_namelen == 0
+ && ret >= 12)
+ || (msg.msg_namelen == sizeof (err_addr)
+ && err_addr.sin_family == AF_INET
+ && memcmp (&err_addr.sin_addr, &sin->sin_addr,
+ sizeof (err_addr.sin_addr)) == 0
+ && err_addr.sin_port == sin->sin_port)))
+ for (cmsg = CMSG_FIRSTHDR (&msg); cmsg;
+ cmsg = CMSG_NXTHDR (&msg, cmsg))
+ if (cmsg->cmsg_level == SOL_IP && cmsg->cmsg_type == IP_RECVERR)
+ {
+ e = (struct sock_extended_err *) CMSG_DATA(cmsg);
+ cu->cu_error.re_errno = e->ee_errno;
+ return (cu->cu_error.re_status = RPC_CANTRECV);
+ }
+ }
+#endif
/* We have some data now */
do {

View File

@ -1,28 +0,0 @@
diff -up libtirpc-0.1.7/configure.in.orig libtirpc-0.1.7/configure.in
--- libtirpc-0.1.7/configure.in.orig 2007-10-17 12:03:25.000000000 -0400
+++ libtirpc-0.1.7/configure.in 2007-10-17 12:07:18.000000000 -0400
@@ -10,6 +10,10 @@ AC_ARG_ENABLE(gss,[ --enable-gss
*) AC_MSG_ERROR(bad value ${enableval} for --enable-gss) ;;
esac],[gss=false])
AM_CONDITIONAL(GSS, test x$gss = xtrue)
+if test x$gss = xtrue; then
+ PKG_CHECK_MODULES(GSSGLUE, libgssglue, [],
+ AC_MSG_ERROR([Unable to locate information required to use libgssglue.]))
+fi
AC_PROG_CC
diff -up libtirpc-0.1.7/src/Makefile.am.orig libtirpc-0.1.7/src/Makefile.am
--- libtirpc-0.1.7/src/Makefile.am.orig 2007-10-17 12:03:25.000000000 -0400
+++ libtirpc-0.1.7/src/Makefile.am 2007-10-17 12:06:19.000000000 -0400
@@ -29,8 +29,8 @@ libtirpc_la_SOURCES += xdr.c xdr_rec.c x
## Secure-RPC
if GSS
libtirpc_la_SOURCES += auth_gss.c authgss_prot.c svc_auth_gss.c
- libtirpc_la_LDFLAGS += -lgssapi
- libtirpc_la_CFLAGS = -DHAVE_RPCSEC_GSS
+ libtirpc_la_LDFLAGS += $(GSSGLUE_LIBS)
+ libtirpc_la_CFLAGS = -DHAVE_RPCSEC_GSS -I/usr/include/gssglue $(GSSGLUE_LIBS)
endif
## libtirpc_a_SOURCES += key_call.c key_prot_xdr.c getpublickey.c

View File

@ -1,51 +0,0 @@
commit 4d77b479511a27fb52b54811020176bb32099444
Author: Steve Dickson <steved@redhat.com>
Date: Mon Feb 18 17:30:46 2008 -0500
Added that libtirpc.pc.in that will create
the /usr/lib/pkgconfig/libtirpc.pc file that is
used by the pkg-config(1) command
Signed-off-by: Steve Dickson <steved@redhat.com>
diff --git a/Makefile.am b/Makefile.am
index 1a212e8..4e1503c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -43,6 +43,9 @@ nobase_include_HEADERS = tirpc/un-namespace.h \
tirpc/rpc/auth_gss.h \
tirpc/rpc/auth_des.h
+pkgconfigdir=$(libdir)/pkgconfig
+pkgconfig_DATA = libtirpc.pc
+
install-exec-local:
cp -p ./doc/etc_netconfig /etc/netconfig
chmod 0644 /etc/netconfig
diff --git a/configure.in b/configure.in
index dc597dd..e907c31 100644
--- a/configure.in
+++ b/configure.in
@@ -27,4 +27,4 @@ AC_CHECK_LIB([pthread], [pthread_create])
AC_CONFIG_FILES([Makefile src/Makefile])
-AC_OUTPUT()
+AC_OUTPUT(libtirpc.pc)
diff --git a/libtirpc.pc.in b/libtirpc.pc.in
new file mode 100644
index 0000000..df9e7ed
--- /dev/null
+++ b/libtirpc.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libtirpc
+Description: Transport Independent RPC Library
+Requires:
+Version: @PACKAGE_VERSION@
+Libs: -L@libdir@ -ltirpc
+Cflags: -I@includedir@/tirpc

View File

@ -1,32 +0,0 @@
diff -up /dev/null libtirpc-0.1.7/man/Makefile.am
--- /dev/null 2008-03-07 09:39:09.380146390 -0500
+++ libtirpc-0.1.7/man/Makefile.am 2008-03-12 14:44:01.000000000 -0400
@@ -0,0 +1,9 @@
+
+man5_MANS = netconfig.5
+man_MANS = bindresvport.3t des_crypt.3t getnetconfig.3t getnetpath.3t \
+ getrpcent.3t getrpcport.3t rpc.3t rpc_clnt_auth.3t rpc_clnt_calls.3t \
+ rpc_clnt_create.3t rpc_secure.3t rpc_soc.3t rpc_svc_calls.3t \
+ rpc_svc_create.3t rpc_svc_err.3t rpc_svc_reg.3t rpc_xdr.3t rtime.3t
+
+EXTRA_DIST = $(man5t_MANS) $(man3t_MANS)
+
diff -up libtirpc-0.1.7/configure.in.orig libtirpc-0.1.7/configure.in
--- libtirpc-0.1.7/configure.in.orig 2008-03-12 14:42:30.000000000 -0400
+++ libtirpc-0.1.7/configure.in 2008-03-12 14:43:15.000000000 -0400
@@ -26,5 +26,5 @@ AC_CHECK_HEADERS([arpa/inet.h fcntl.h li
AC_CHECK_LIB([pthread], [pthread_create])
-AC_CONFIG_FILES([Makefile src/Makefile])
+AC_CONFIG_FILES([Makefile src/Makefile man/Makefile])
AC_OUTPUT(libtirpc.pc)
diff -up libtirpc-0.1.7/Makefile.am.orig libtirpc-0.1.7/Makefile.am
--- libtirpc-0.1.7/Makefile.am.orig 2008-03-12 14:42:30.000000000 -0400
+++ libtirpc-0.1.7/Makefile.am 2008-03-12 14:43:15.000000000 -0400
@@ -1,4 +1,4 @@
-SUBDIRS = src
+SUBDIRS = src man
nobase_include_HEADERS = tirpc/un-namespace.h \
tirpc/spinlock.h \

View File

@ -1,15 +0,0 @@
--- libtirpc-0.1.7/doc/etc_netconfig.orig 2005-05-18 01:10:50.000000000 -0400
+++ libtirpc-0.1.7/doc/etc_netconfig 2007-07-24 09:45:40.000000000 -0400
@@ -10,10 +10,10 @@
# The <device> and <nametoaddr_libs> fields are always empty in this
# implementation.
#
-#udp6 tpi_clts v inet6 udp - -
-#tcp6 tpi_cots_ord v inet6 tcp - -
udp tpi_clts v inet udp - -
tcp tpi_cots_ord v inet tcp - -
+udp6 tpi_clts - inet6 udp6 - -
+tcp6 tpi_cots_ord - inet6 tcp6 - -
rawip tpi_raw - inet - - -
local tpi_cots_ord - loopback - - -
unix tpi_cots_ord - loopback - - -

View File

@ -1,12 +0,0 @@
--- libtirpc-0.1.7/src/xdr_float.c.orig 2005-05-18 01:10:50.000000000 -0400
+++ libtirpc-0.1.7/src/xdr_float.c 2006-08-16 08:41:43.000000000 -0400
@@ -58,7 +58,8 @@
#if defined(__m68k__) || defined(__sparc__) || defined(__i386__) || \
defined(__mips__) || defined(__ns32k__) || defined(__alpha__) || \
defined(__arm32__) || defined(__ppc__) || defined(__ia64__) || \
- defined(__arm26__) || defined(__sparc64__) || defined(__amd64__)
+ defined(__arm26__) || defined(__sparc64__) || defined(__amd64__) || \
+ defined(__powerpc__) || defined(__s390__)
#include <bits/endian.h>
#define IEEEFP
#endif

View File

@ -1,150 +0,0 @@
commit a3a3a4e5157932c254200e3b31a78739f5878071
Author: Steve Dickson <steved@redhat.com>
Date: Fri May 4 11:27:43 2007 -0400
Ignore the return value of snprintf() and use strlen() instead
to bump the pointer in clnt_sperror()
Also removed calls to assert(), not needed.
Signed-off-by: Steve Dickson <steved@redhat.com>
diff --git a/src/clnt_perror.c b/src/clnt_perror.c
index e46d95f..8f53f8e 100644
--- a/src/clnt_perror.c
+++ b/src/clnt_perror.c
@@ -36,7 +36,6 @@
* Copyright (C) 1984, Sun Microsystems, Inc.
*
*/
-#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -75,8 +74,8 @@ clnt_sperror(rpch, s)
char *strstart;
size_t len, i;
- assert(rpch != NULL);
- assert(s != NULL);
+ if (rpch == NULL || s == NULL)
+ return(0);
str = _buf(); /* side effect: sets CLNT_PERROR_BUFLEN */
if (str == 0)
@@ -85,7 +84,8 @@ clnt_sperror(rpch, s)
strstart = str;
CLNT_GETERR(rpch, &e);
- if ((i = snprintf(str, len, "%s: ", s)) > 0) {
+ if (snprintf(str, len, "%s: ", s) > 0) {
+ i = strlen(str);
str += i;
len -= i;
}
@@ -113,7 +113,8 @@ clnt_sperror(rpch, s)
case RPC_CANTSEND:
case RPC_CANTRECV:
- i = snprintf(str, len, "; errno = %s", strerror(e.re_errno));
+ snprintf(str, len, "; errno = %s", strerror(e.re_errno));
+ i = strlen(str);
if (i > 0) {
str += i;
len -= i;
@@ -121,8 +122,9 @@ clnt_sperror(rpch, s)
break;
case RPC_VERSMISMATCH:
- i = snprintf(str, len, "; low version = %u, high version = %u",
+ snprintf(str, len, "; low version = %u, high version = %u",
e.re_vers.low, e.re_vers.high);
+ i = strlen(str);
if (i > 0) {
str += i;
len -= i;
@@ -131,18 +133,20 @@ clnt_sperror(rpch, s)
case RPC_AUTHERROR:
err = auth_errmsg(e.re_why);
- i = snprintf(str, len, "; why = ");
+ snprintf(str, len, "; why = ");
+ i = strlen(str);
if (i > 0) {
str += i;
len -= i;
}
if (err != NULL) {
- i = snprintf(str, len, "%s",err);
+ snprintf(str, len, "%s",err);
} else {
- i = snprintf(str, len,
+ snprintf(str, len,
"(unknown authentication error - %d)",
(int) e.re_why);
}
+ i = strlen(str);
if (i > 0) {
str += i;
len -= i;
@@ -150,8 +154,9 @@ clnt_sperror(rpch, s)
break;
case RPC_PROGVERSMISMATCH:
- i = snprintf(str, len, "; low version = %u, high version = %u",
+ snprintf(str, len, "; low version = %u, high version = %u",
e.re_vers.low, e.re_vers.high);
+ i = strlen(str);
if (i > 0) {
str += i;
len -= i;
@@ -159,8 +164,9 @@ clnt_sperror(rpch, s)
break;
default: /* unknown */
- i = snprintf(str, len, "; s1 = %u, s2 = %u",
+ snprintf(str, len, "; s1 = %u, s2 = %u",
e.re_lb.s1, e.re_lb.s2);
+ i = strlen(str);
if (i > 0) {
str += i;
len -= i;
@@ -177,8 +183,8 @@ clnt_perror(rpch, s)
const char *s;
{
- assert(rpch != NULL);
- assert(s != NULL);
+ if (rpch == NULL || s == NULL)
+ return;
(void) fprintf(stderr, "%s\n", clnt_sperror(rpch,s));
}
@@ -236,13 +242,15 @@ clnt_spcreateerror(s)
char *str;
size_t len, i;
- assert(s != NULL);
+ if (s == NULL)
+ return(0);
str = _buf(); /* side effect: sets CLNT_PERROR_BUFLEN */
if (str == 0)
return(0);
len = CLNT_PERROR_BUFLEN;
- i = snprintf(str, len, "%s: ", s);
+ snprintf(str, len, "%s: ", s);
+ i = strlen(str);
if (i > 0)
len -= i;
(void)strncat(str, clnt_sperrno(rpc_createerr.cf_stat), len - 1);
@@ -287,7 +295,8 @@ clnt_pcreateerror(s)
const char *s;
{
- assert(s != NULL);
+ if (s == NULL)
+ return;
(void) fprintf(stderr, "%s\n", clnt_spcreateerror(s));
}

View File

@ -1,52 +0,0 @@
commit f8ff8f0de33606ff544dc87c0a9993fd3a0f5475
Author: Steve Dickson <steved@redhat.com>
Date: Mon Jul 30 07:26:45 2007 -0400
- Make sure remote address (xp_rtaddr) is populated
with the correct type of address.
Signed-off-by: Steve Dickson <steved@redhat.com>
diff --git a/src/svc_vc.c b/src/svc_vc.c
index 48494e1..3d77aef 100644
--- a/src/svc_vc.c
+++ b/src/svc_vc.c
@@ -239,7 +239,10 @@ svc_fd_create(fd, sendsize, recvsize)
warnx("svc_fd_create: no mem for local addr");
goto freedata;
}
- memcpy(ret->xp_rtaddr.buf, &sin6, (size_t)sizeof(ss));
+ if (ss.ss_family == AF_INET)
+ memcpy(ret->xp_rtaddr.buf, &ss, (size_t)sizeof(ss));
+ else
+ memcpy(ret->xp_rtaddr.buf, &sin6, (size_t)sizeof(ss));
#ifdef PORTMAP
if (sin6.sin6_family == AF_INET6 || sin6.sin6_family == AF_LOCAL) {
memcpy(&ret->xp_raddr, ret->xp_rtaddr.buf,
@@ -343,20 +346,23 @@ again:
newxprt = makefd_xprt(sock, r->sendsize, r->recvsize);
if (addr.ss_family == AF_INET) {
map_ipv4_to_ipv6((struct sockaddr_in *)&addr, &sin6);
- len = sizeof(struct sockaddr_in6);
} else {
memcpy(&sin6, &addr, len);
}
newxprt->xp_rtaddr.buf = mem_alloc(len);
if (newxprt->xp_rtaddr.buf == NULL)
return (FALSE);
- memcpy(newxprt->xp_rtaddr.buf, &sin6, len);
+
+ if (addr.ss_family == AF_INET)
+ memcpy(newxprt->xp_rtaddr.buf, &addr, len);
+ else
+ memcpy(newxprt->xp_rtaddr.buf, &sin6, len);
newxprt->xp_rtaddr.maxlen = newxprt->xp_rtaddr.len = len;
#ifdef PORTMAP
if (sin6.sin6_family == AF_INET6 || sin6.sin6_family == AF_LOCAL) {
memcpy(&newxprt->xp_raddr, newxprt->xp_rtaddr.buf,
sizeof(struct sockaddr_in6));
- newxprt->xp_addrlen = len;
+ newxprt->xp_addrlen = sizeof(struct sockaddr_in6);
}
#endif /* PORTMAP */
if (__rpc_fd2sockinfo(sock, &si) && si.si_proto == IPPROTO_TCP) {

View File

@ -1,12 +0,0 @@
--- libtirpc-0.1.7/tirpc/rpc/svc_auth.h.orig 2005-05-18 01:10:51.000000000 -0400
+++ libtirpc-0.1.7/tirpc/rpc/svc_auth.h 2006-08-28 08:13:37.801283000 -0400
@@ -54,6 +54,9 @@
caddr_t svc_ah_private;
} SVCAUTH;
+#define SVCAUTH_DESTROY(cred) ((*(cred)->svc_ah_ops->svc_ah_destroy)())
+#define svcauth_destroy(cred) ((*(cred)->svc_ah_ops->svc_ah_destroy)())
+
/*
* Server side authenticator
*/

View File

@ -1,45 +0,0 @@
commit 30431c6d846eab1bc6b7a3a91a7894f3acf2680f
Author: Steve Dickson <steved@redhat.com>
Date: Thu Apr 26 14:42:16 2007 -0400
Check for buffer overflow in xdr_string.
Signed-off-by: Steve Dickson <steved@redhat.com>
diff --git a/src/xdr.c b/src/xdr.c
index 764c30f..292723b 100644
--- a/src/xdr.c
+++ b/src/xdr.c
@@ -669,6 +669,8 @@ xdr_string(xdrs, cpp, maxsize)
}
/* FALLTHROUGH */
case XDR_ENCODE:
+ if (sp == NULL)
+ return FALSE;
size = strlen(sp);
break;
case XDR_DECODE:
@@ -681,6 +683,13 @@ xdr_string(xdrs, cpp, maxsize)
return (FALSE);
}
nodesize = size + 1;
+ if (nodesize == 0) {
+ /* This means an overflow. It a bug in the caller which
+ * provided a too large maxsize but nevertheless catch it
+ * here.
+ */
+ return FALSE;
+ }
/*
* now deal with the actual bytes
@@ -688,9 +697,6 @@ xdr_string(xdrs, cpp, maxsize)
switch (xdrs->x_op) {
case XDR_DECODE:
- if (nodesize == 0) {
- return (TRUE);
- }
if (sp == NULL)
*cpp = sp = mem_alloc(nodesize);
if (sp == NULL) {

View File

@ -1,13 +1,13 @@
Name: libtirpc
Version: 0.1.7
Release: 18%{?dist}
Version: 0.1.8
Release: 1%{?dist}
Summary: Transport Independent RPC Library
Group: System Environment/Libraries
License: GPL
URL: http://nfsv4.bullopensource.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Source0: http://nfsv4.bullopensource.org/tarballs/tirpc/%{name}-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Source0: http://downloads.sourceforge.net/libtirpc/libtirpc-%{version}.tar.bz2
BuildRequires: automake, autoconf, libtool, pkgconfig
BuildRequires: libgssglue-devel
@ -30,23 +30,8 @@ Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires(devel): pkgconfig man
Patch1: libtirpc-0.1.7-netconfig.patch
Patch2: libtirpc-0.1.7-gssglue.patch
Patch3: libtirpc-0.1.7-svcauthnone.patch
Patch4: libtirpc-0.1.7-ppc64.patch
Patch5: libtirpc-0.1.7-svcauthdestroy.patch
Patch6: libtirpc-0.1.7-xdr_bufferoverlow.patch
Patch7: libtirpc-0.1.7-bindresvport_ports.patch
Patch8: libtirpc-0.1.7-svc-run.patch
Patch9: libtirpc-0.1.7-clnt_raw-mutex.patch
Patch10: libtirpc-0.1.7-snprintf.patch
Patch11: libtirpc-0.1.7-bindresvport-ntohs.patch
Patch12: libtirpc-0.1.7-dgcall-iprecverr.patch
Patch13: libtirpc-0.1.7-svc-rtaddr.patch
Patch14: libtirpc-0.1.7-arm.patch
Patch15: libtirpc-0.1.7-bufoverflow.patch
Patch16: libtirpc-0.1.7-libtirpc-pc.patch
Patch17: libtirpc-0.1.7-man-install.patch
Patch1: libtirpc-0.1.7-svcauthnone.patch
Patch2: libtirpc-0.1.7-svc-run.patch
Patch100: libtirpc-0.1.7-compile.patch
@ -59,21 +44,6 @@ developing programs which use the tirpc library.
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch100 -p1
@ -83,10 +53,6 @@ find . -name "*.orig" | xargs rm -f
%build
autoreconf -fisv
%configure --enable-gss
for i in man/*.3; do
mv $i "$i"t
done
exit
make all
%install
@ -176,6 +142,9 @@ rm -rf %{buildroot}
%{_mandir}/*/*
%changelog
* Tue Jun 10 2008 Steve Dickson <steved@redhat.com> 0.1.8-1
- Update to latest upstream version 0.1.8
* Wed Mar 12 2008 Steve Dickson <steved@redhat.com> 0.1.7-18
- Install man pages in the 3t section

View File

@ -1 +1 @@
6b03f1567132abf546ff44643e136621 libtirpc-0.1.7.tar.bz2
22b28d3799aab5d13ffbb2ab82cb7deb libtirpc-0.1.8.tar.bz2