libtirpc: upgrade to 1.0.1

0.2.5  -> 1.0.1

Fixed build with uclibc and musl

(From OE-Core rev: 79fed87ca1fb2f33080920a97cf036d53f267d12)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Maxin B. John 2015-12-21 17:59:55 +02:00 committed by Richard Purdie
parent 5754b8304d
commit 866c693cd3
5 changed files with 1793 additions and 41 deletions

View File

@ -0,0 +1,62 @@
Subject: [PATCH] Add missing rwlock_unlocks in xprt_register
It looks like in b2c9430f46c4ac848957fb8adaac176a3f6ac03f when svc_run
switched to poll, an early return was added, but the rwlock was not
unlocked.
I observed that rpcbind built against libtirpc-1.0.1 would handle only
one request before hanging, and tracked it down to a missing
rwlock_unlock here.
Fixes: b2c9430f46c4 ('Use poll() instead of select() in svc_run()')
Upstream-Status: Backport
Signed-off-by: Michael Forney <mforney@mforney.org>
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Maxin B. John <maxin.john@intel.com>
---
src/svc.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/svc.c b/src/svc.c
index 9c41445..b59467b 100644
--- a/src/svc.c
+++ b/src/svc.c
@@ -99,7 +99,7 @@ xprt_register (xprt)
{
__svc_xports = (SVCXPRT **) calloc (_rpc_dtablesize(), sizeof (SVCXPRT *));
if (__svc_xports == NULL)
- return;
+ goto unlock;
}
if (sock < _rpc_dtablesize())
{
@@ -120,14 +120,14 @@ xprt_register (xprt)
svc_pollfd[i].fd = sock;
svc_pollfd[i].events = (POLLIN | POLLPRI |
POLLRDNORM | POLLRDBAND);
- return;
+ goto unlock;
}
new_svc_pollfd = (struct pollfd *) realloc (svc_pollfd,
sizeof (struct pollfd)
* (svc_max_pollfd + 1));
if (new_svc_pollfd == NULL) /* Out of memory */
- return;
+ goto unlock;
svc_pollfd = new_svc_pollfd;
++svc_max_pollfd;
@@ -135,6 +135,7 @@ xprt_register (xprt)
svc_pollfd[svc_max_pollfd - 1].events = (POLLIN | POLLPRI |
POLLRDNORM | POLLRDBAND);
}
+unlock:
rwlock_unlock (&svc_fd_lock);
}
--
2.5.3

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,144 @@
uclibc and musl does not provide des functionality. Lets disable it.
Upstream-Status: Inappropriate [uclibc and musl specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Maxin B. John <maxin.john@intel.com>
---
diff -Naur libtirpc-1.0.1-orig/src/Makefile.am libtirpc-1.0.1/src/Makefile.am
--- libtirpc-1.0.1-orig/src/Makefile.am 2015-10-30 17:15:14.000000000 +0200
+++ libtirpc-1.0.1/src/Makefile.am 2015-12-21 15:56:17.094702429 +0200
@@ -22,9 +22,8 @@
pmap_prot.c pmap_prot2.c pmap_rmt.c rpc_prot.c rpc_commondata.c \
rpc_callmsg.c rpc_generic.c rpc_soc.c rpcb_clnt.c rpcb_prot.c \
rpcb_st_xdr.c svc.c svc_auth.c svc_dg.c svc_auth_unix.c svc_auth_none.c \
- svc_auth_des.c \
svc_generic.c svc_raw.c svc_run.c svc_simple.c svc_vc.c getpeereid.c \
- auth_time.c auth_des.c authdes_prot.c debug.c
+ debug.c
## XDR
libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_reference.c xdr_stdio.c xdr_sizeof.c
@@ -41,8 +40,8 @@
libtirpc_la_CFLAGS = -DHAVE_RPCSEC_GSS $(GSSAPI_CFLAGS)
endif
-libtirpc_la_SOURCES += key_call.c key_prot_xdr.c getpublickey.c
-libtirpc_la_SOURCES += netname.c netnamer.c rpcdname.c rtime.c
+#libtirpc_la_SOURCES += key_call.c key_prot_xdr.c getpublickey.c
+#libtirpc_la_SOURCES += netname.c netnamer.c rpcdname.c rtime.c
CLEANFILES = cscope.* *~
DISTCLEANFILES = Makefile.in
diff -Naur libtirpc-1.0.1-orig/src/rpc_soc.c libtirpc-1.0.1/src/rpc_soc.c
--- libtirpc-1.0.1-orig/src/rpc_soc.c 2015-10-30 17:15:14.000000000 +0200
+++ libtirpc-1.0.1/src/rpc_soc.c 2015-12-21 15:56:17.095702416 +0200
@@ -61,7 +61,6 @@
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
-#include <rpcsvc/nis.h>
#include "rpc_com.h"
@@ -522,86 +521,6 @@
}
/*
- * Create the client des authentication object. Obsoleted by
- * authdes_seccreate().
- */
-AUTH *
-authdes_create(servername, window, syncaddr, ckey)
- char *servername; /* network name of server */
- u_int window; /* time to live */
- struct sockaddr *syncaddr; /* optional hostaddr to sync with */
- des_block *ckey; /* optional conversation key to use */
-{
- AUTH *nauth;
- char hostname[NI_MAXHOST];
-
- if (syncaddr) {
- /*
- * Change addr to hostname, because that is the way
- * new interface takes it.
- */
- switch (syncaddr->sa_family) {
- case AF_INET:
- if (getnameinfo(syncaddr, sizeof(struct sockaddr_in), hostname,
- sizeof hostname, NULL, 0, 0) != 0)
- goto fallback;
- break;
- case AF_INET6:
- if (getnameinfo(syncaddr, sizeof(struct sockaddr_in6), hostname,
- sizeof hostname, NULL, 0, 0) != 0)
- goto fallback;
- break;
- default:
- goto fallback;
- }
- nauth = authdes_seccreate(servername, window, hostname, ckey);
- return (nauth);
- }
-fallback:
- return authdes_seccreate(servername, window, NULL, ckey);
-}
-
-/*
- * Create the client des authentication object. Obsoleted by
- * authdes_pk_seccreate().
- */
-extern AUTH *authdes_pk_seccreate(const char *, netobj *, u_int, const char *,
- const des_block *, nis_server *);
-
-AUTH *
-authdes_pk_create(servername, pkey, window, syncaddr, ckey)
- char *servername; /* network name of server */
- netobj *pkey; /* public key */
- u_int window; /* time to live */
- struct sockaddr *syncaddr; /* optional hostaddr to sync with */
- des_block *ckey; /* optional conversation key to use */
-{
- AUTH *nauth;
- char hostname[NI_MAXHOST];
-
- if (syncaddr) {
- /*
- * Change addr to hostname, because that is the way
- * new interface takes it.
- */
- switch (syncaddr->sa_family) {
- case AF_INET:
- if (getnameinfo(syncaddr, sizeof(struct sockaddr_in), hostname,
- sizeof hostname, NULL, 0, 0) != 0)
- goto fallback;
- break;
- default:
- goto fallback;
- }
- nauth = authdes_pk_seccreate(servername, pkey, window, hostname, ckey, NULL);
- return (nauth);
- }
-fallback:
- return authdes_pk_seccreate(servername, pkey, window, NULL, ckey, NULL);
-}
-
-
-/*
* Create a client handle for a unix connection. Obsoleted by clnt_vc_create()
*/
CLIENT *
diff -Naur libtirpc-1.0.1-orig/src/svc_auth.c libtirpc-1.0.1/src/svc_auth.c
--- libtirpc-1.0.1-orig/src/svc_auth.c 2015-10-30 17:15:14.000000000 +0200
+++ libtirpc-1.0.1/src/svc_auth.c 2015-12-21 15:56:17.095702416 +0200
@@ -114,9 +114,6 @@
case AUTH_SHORT:
dummy = _svcauth_short(rqst, msg);
return (dummy);
- case AUTH_DES:
- dummy = _svcauth_des(rqst, msg);
- return (dummy);
#ifdef HAVE_RPCSEC_GSS
case RPCSEC_GSS:
dummy = _svcauth_gss(rqst, msg, no_dispatch);

View File

@ -1,38 +0,0 @@
uclibc does not provide des functionality unlike eglibc so lets disable ssl support
Upstream-Status: Inappropriate [uclibc specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Index: libtirpc-0.2.5/src/rpc_soc.c
===================================================================
--- libtirpc-0.2.5.orig/src/rpc_soc.c
+++ libtirpc-0.2.5/src/rpc_soc.c
@@ -520,6 +520,7 @@ clnt_broadcast(prog, vers, proc, xargs,
(resultproc_t) rpc_wrap_bcast, "udp");
}
+#if 0
/*
* Create the client des authentication object. Obsoleted by
* authdes_seccreate().
@@ -551,6 +552,7 @@ fallback:
dummy = authdes_seccreate(servername, window, NULL, ckey);
return (dummy);
}
+#endif
/*
* Create a client handle for a unix connection. Obsoleted by clnt_vc_create()
Index: libtirpc-0.2.5/src/Makefile.am
===================================================================
--- libtirpc-0.2.5.orig/src/Makefile.am
+++ libtirpc-0.2.5/src/Makefile.am
@@ -51,7 +51,7 @@ libtirpc_la_SOURCES = auth_none.c auth_u
rpc_callmsg.c rpc_generic.c rpc_soc.c rpcb_clnt.c rpcb_prot.c \
rpcb_st_xdr.c svc.c svc_auth.c svc_dg.c svc_auth_unix.c svc_auth_none.c \
svc_generic.c svc_raw.c svc_run.c svc_simple.c svc_vc.c getpeereid.c \
- auth_time.c auth_des.c authdes_prot.c debug.c
+ auth_time.c debug.c
## XDR
libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_reference.c xdr_stdio.c

View File

@ -13,14 +13,19 @@ PROVIDES = "virtual/librpc"
SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.bz2;name=libtirpc \
${GENTOO_MIRROR}/${BPN}-glibc-nfs.tar.xz;name=glibc-nfs \
file://libtirpc-0.2.1-fortify.patch \
file://0001-Add-missing-rwlock_unlocks-in-xprt_register.patch \
"
SRC_URI_append_libc-uclibc = " file://remove-des-uclibc.patch \
SRC_URI_append_libc-uclibc = " file://remove-des-functionality.patch \
file://va_list.patch \
"
SRC_URI[libtirpc.md5sum] = "8cd41a5ef5a9b50d0fb6abb98af15368"
SRC_URI[libtirpc.sha256sum] = "62f9de7c2c8686c568757730e1fef66502a0e00d6cacf33546d0267984e002db"
SRC_URI_append_libc-musl = " file://remove-des-functionality.patch \
file://Use-netbsd-queue.h.patch \
"
SRC_URI[libtirpc.md5sum] = "36ce1c0ff80863bb0839d54aa0b94014"
SRC_URI[libtirpc.sha256sum] = "5156974f31be7ccbc8ab1de37c4739af6d9d42c87b1d5caf4835dda75fcbb89e"
SRC_URI[glibc-nfs.md5sum] = "5ae500b9d0b6b72cb875bc04944b9445"
SRC_URI[glibc-nfs.sha256sum] = "2677cfedf626f3f5a8f6e507aed5bb8f79a7453b589d684dbbc086e755170d83"