Skip to contentSkip to conversation

libtirpc: upgrade to 1.0.1

PATCH New Maxin B. John 1 participant 2 messages Dec 21, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 libtirpc: upgrade to 1.0.1

0.2.5 -> 1.0.1

Fixed build with uclibc and musl

---
 ...d-missing-rwlock_unlocks-in-xprt_register.patch |   62 +
 .../libtirpc/libtirpc/Use-netbsd-queue.h.patch     | 1579 ++++++++++++++++++++
 .../libtirpc/remove-des-functionality.patch        |  144 ++
 .../libtirpc/libtirpc/remove-des-uclibc.patch      |   38 -
 .../{libtirpc_0.2.5.bb => libtirpc_1.0.1.bb}       |   11 +-
 5 files changed, 1793 insertions(+), 41 deletions(-)
 create mode 100644 meta/recipes-extended/libtirpc/libtirpc/0001-Add-missing-rwlock_unlocks-in-xprt_register.patch
 create mode 100644 meta/recipes-extended/libtirpc/libtirpc/Use-netbsd-queue.h.patch
 create mode 100644 meta/recipes-extended/libtirpc/libtirpc/remove-des-functionality.patch
 delete mode 100644 meta/recipes-extended/libtirpc/libtirpc/remove-des-uclibc.patch
 rename meta/recipes-extended/libtirpc/{libtirpc_0.2.5.bb => libtirpc_1.0.1.bb} (71%)
meta/recipes-extended/libtirpc/libtirpc/0001-Add-missing-rwlock_unlocks-in-xprt_register.patch new file +62 -0
new file mode 100644
index 0000000..50613ba
@@ -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 <[email protected]>
+Signed-off-by: Steve Dickson <[email protected]>
+Signed-off-by: Maxin B. John <[email protected]>
+---
+ 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
+
meta/recipes-extended/libtirpc/libtirpc/Use-netbsd-queue.h.patch new file +1579 -0

1,579 lines not on this page · raw message

meta/recipes-extended/libtirpc/libtirpc/remove-des-functionality.patch new file +144 -0

144 lines not on this page · raw message

meta/recipes-extended/libtirpc/libtirpc/remove-des-uclibc.patch deleted +0 -38
deleted file mode 100644
index 553b1ff..0000000
@@ -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 <[email protected]>
-
-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
meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb renamed from meta/recipes-extended/libtirpc/libtirpc_0.2.5.bb +8 -3
similarity index 71%
rename from meta/recipes-extended/libtirpc/libtirpc_0.2.5.bb
rename to meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb
index 330b829..302dc50 100644
@@ -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"
 
Signature · 1 line
2.4.0
#1 lore raw

PATCH v2 2/2 rpcbind: Fix build with libtirpc 1.0.1

libtirpc 1.0.1 uses the SVC_XP_AUTH macro to access xp_auth. Update rpcbind to follow the same way.

---
 ...ly-Don-t-use-the-xp_auth-pointer-directly.patch | 43 ++++++++++++++++++++++
 meta/recipes-extended/rpcbind/rpcbind_0.2.3.bb     |  1 +
 2 files changed, 44 insertions(+)
 create mode 100644 meta/recipes-extended/rpcbind/rpcbind/0001-handle_reply-Don-t-use-the-xp_auth-pointer-directly.patch
meta/recipes-extended/rpcbind/rpcbind/0001-handle_reply-Don-t-use-the-xp_auth-pointer-directly.patch new file +43 -0
new file mode 100644
index 0000000..16b763e
@@ -0,0 +1,43 @@
+From 9194122389f2a56b1cd1f935e64307e2e963c2da Mon Sep 17 00:00:00 2001
+From: Steve Dickson <[email protected]>
+Date: Mon, 2 Nov 2015 17:05:18 -0500
+Subject: [PATCH] handle_reply: Don't use the xp_auth pointer directly
+
+In the latest libtirpc version to access the xp_auth
+one must use the SVC_XP_AUTH macro. To be backwards
+compatible a couple ifdefs were added to use the
+macro when it exists.
+
+Upstream-Status: Backport
+
+Signed-off-by: Steve Dickson <[email protected]>
+Signed-off-by: Maxin B. John <[email protected]>
+---
+ src/rpcb_svc_com.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c
+index 4ae93f1..22d6c84 100644
+--- a/src/rpcb_svc_com.c
++++ b/src/rpcb_svc_com.c
+@@ -1295,10 +1295,17 @@ handle_reply(int fd, SVCXPRT *xprt)
+ 	a.rmt_localvers = fi->versnum;
+ 
+ 	xprt_set_caller(xprt, fi);
++#if defined(SVC_XP_AUTH)
++	SVC_XP_AUTH(xprt) = svc_auth_none;
++#else 
+ 	xprt->xp_auth = &svc_auth_none;
++#endif
+ 	svc_sendreply(xprt, (xdrproc_t) xdr_rmtcall_result, (char *) &a);
++#if !defined(SVC_XP_AUTH)
+ 	SVCAUTH_DESTROY(xprt->xp_auth);
+ 	xprt->xp_auth = NULL;
++#endif
++
+ done:
+ 	if (buffer)
+ 		free(buffer);
+-- 
+2.4.0
+
meta/recipes-extended/rpcbind/rpcbind_0.2.3.bb +1 -0
index ecd3ba8..c19a197 100644
@@ -14,6 +14,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/rpcbind/rpcbind-${PV}.tar.bz2 \
            file://init.d \
            file://0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch \
            file://remove-sys-queue.patch \
+           file://0001-handle_reply-Don-t-use-the-xp_auth-pointer-directly.patch \
            ${UCLIBCPATCHES} \
            ${MUSLPATCHES} \
            file://rpcbind.conf \
Signature · 1 line
2.4.0