From 91ff6aa42e8b51853374d385ffd4b0451e295333f15422747d03d17cf4bcdd05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Wed, 18 Nov 2015 11:15:36 +0000 Subject: [PATCH 1/2] Accepting request 345010 from home:kukuk:NSL - Add 0002-revert-auth.patch: revert old patch no longer working with libtirpc 1.0.1 (http://sourceforge.net/p/libtirpc/mailman/message/34585439/) - Add 099-poll.patch: use libtirpc with poll() implementation OBS-URL: https://build.opensuse.org/request/show/345010 OBS-URL: https://build.opensuse.org/package/show/network/rpcbind?expand=0&rev=56 --- 0002-revert-auth.patch | 35 +++++++++++++++++++ 099-poll.patch | 76 ++++++++++++++++++++++++++++++++++++++++++ rpcbind.changes | 12 +++++++ rpcbind.spec | 4 +++ 4 files changed, 127 insertions(+) create mode 100644 0002-revert-auth.patch create mode 100644 099-poll.patch diff --git a/0002-revert-auth.patch b/0002-revert-auth.patch new file mode 100644 index 0000000..08965b2 --- /dev/null +++ b/0002-revert-auth.patch @@ -0,0 +1,35 @@ +commit 86036582c001e99075f4d74cb3829df39f2a9ddf +Author: Frank Hirtz +Date: Tue Oct 23 11:38:20 2012 -0400 + + rpcbind is "swallowing" broadcast RPC replies + + If xp_auth is NULL, the transport routines will not send + the reply. This patch fixes that problem. + + Signed-off-by: Steve Dickson + +diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c +index 5bb9a44..f6bd6bd 100644 +--- a/src/rpcb_svc_com.c ++++ b/src/rpcb_svc_com.c +@@ -1227,6 +1227,8 @@ send_svcsyserr(SVCXPRT *xprt, struct finfo *fi) + return; + } + ++extern SVCAUTH svc_auth_none; ++ + static void + handle_reply(int fd, SVCXPRT *xprt) + { +@@ -1293,7 +1295,10 @@ handle_reply(int fd, SVCXPRT *xprt) + a.rmt_localvers = fi->versnum; + + xprt_set_caller(xprt, fi); ++ xprt->xp_auth = &svc_auth_none; + svc_sendreply(xprt, (xdrproc_t) xdr_rmtcall_result, (char *) &a); ++ SVCAUTH_DESTROY(xprt->xp_auth); ++ xprt->xp_auth = NULL; + done: + if (buffer) + free(buffer); diff --git a/099-poll.patch b/099-poll.patch new file mode 100644 index 0000000..457f512 --- /dev/null +++ b/099-poll.patch @@ -0,0 +1,76 @@ +diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c +index ff9ce6b..d675eda 100644 +--- a/src/rpcb_svc_com.c ++++ b/src/rpcb_svc_com.c +@@ -1097,35 +1097,28 @@ netbuffree(struct netbuf *ap) + } + + +-#define MASKVAL (POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND) +-extern bool_t __svc_clean_idle(fd_set *, int, bool_t); +- + void + my_svc_run() + { +- size_t nfds; +- struct pollfd pollfds[FD_SETSIZE]; + int poll_ret, check_ret; + int n; +-#ifdef SVC_RUN_DEBUG +- int i; +-#endif +- register struct pollfd *p; +- fd_set cleanfds; + + for (;;) { +- p = pollfds; +- for (n = 0; n <= svc_maxfd; n++) { +- if (FD_ISSET(n, &svc_fdset)) { +- p->fd = n; +- p->events = MASKVAL; +- p++; +- } +- } +- nfds = p - pollfds; +- poll_ret = 0; ++ struct pollfd my_pollfd[svc_max_pollfd]; ++ int i; ++ ++ if (svc_max_pollfd == 0 && svc_pollfd == NULL) ++ return; + +- switch (poll_ret = poll(pollfds, nfds, 30 * 1000)) { ++ ++ for (i = 0; i < svc_max_pollfd; ++i) ++ { ++ my_pollfd[i].fd = svc_pollfd[i].fd; ++ my_pollfd[i].events = svc_pollfd[i].events; ++ my_pollfd[i].revents = 0; ++ } ++ ++ switch (poll_ret = poll(my_pollfd, svc_max_pollfd, 30 * 1000)) { + case -1: + /* + * We ignore all errors, continuing with the assumption +@@ -1133,8 +1126,6 @@ my_svc_run() + * other outside event) and not caused by poll(). + */ + case 0: +- cleanfds = svc_fdset; +- __svc_clean_idle(&cleanfds, 30, FALSE); + continue; + default: + /* +@@ -1144,10 +1135,10 @@ my_svc_run() + * don't call svc_getreq_poll. Otherwise, there + * must be another so we must call svc_getreq_poll. + */ +- if ((check_ret = check_rmtcalls(pollfds, nfds)) == ++ if ((check_ret = check_rmtcalls(my_pollfd, svc_max_pollfd)) == + poll_ret) + continue; +- svc_getreq_poll(pollfds, poll_ret-check_ret); ++ svc_getreq_poll(my_pollfd, poll_ret-check_ret); + } + } + } diff --git a/rpcbind.changes b/rpcbind.changes index cbaa7cc..488754a 100644 --- a/rpcbind.changes +++ b/rpcbind.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Tue Nov 17 14:20:28 CET 2015 - kukuk@suse.de + +- Add 0002-revert-auth.patch: revert old patch no longer working + with libtirpc 1.0.1 + (http://sourceforge.net/p/libtirpc/mailman/message/34585439/) + +------------------------------------------------------------------- +Tue Jul 14 16:52:03 CEST 2015 - kukuk@suse.de + +- Add 099-poll.patch: use libtirpc with poll() implementation + ------------------------------------------------------------------- Thu Apr 30 09:36:21 CEST 2015 - kukuk@suse.de diff --git a/rpcbind.spec b/rpcbind.spec index ba93bbd..cd51d18 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -36,11 +36,13 @@ BuildRequires: pkgconfig(libsystemd-daemon) PreReq: %fillup_prereq Requires(pre): /usr/sbin/useradd Patch1: 0001-systemd-unit-files.patch +Patch2: 0002-revert-auth.patch Patch8: 0008-First-part-of-init_transport-refactoring.patch Patch9: 0009-init_transport-move-the-registration-code-into-a-sep.patch Patch10: 0010-Fix-the-behavior-when-specifying-the-h-option.patch Patch11: 0011-Clean-up-the-way-we-handle-the-h-option-in-init_tran.patch Patch14: 0014-When-using-systemd-redirect-syslog-calls-to-the-syst.patch +Patch99: 099-poll.patch %define statefile /var/lib/portmap.state %{?systemd_requires} @@ -57,11 +59,13 @@ regards to portmap. %setup -q cp %{SOURCE4} . %patch1 -p1 +%patch2 -p1 -R #%patch8 -p1 #%patch9 -p1 #%patch10 -p1 #%patch11 -p1 #%patch14 -p1 +%patch99 -p1 %build autoreconf -fiv From 387fd3baf9c94989c7312554394e95fa027e4a8dff0adce7a923097537e47d74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Fri, 27 Nov 2015 07:53:03 +0000 Subject: [PATCH 2/2] OBS-URL: https://build.opensuse.org/package/show/network/rpcbind?expand=0&rev=57 --- rpcbind.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpcbind.spec b/rpcbind.spec index cd51d18..a0be732 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -28,7 +28,7 @@ Source2: sysconfig.rpcbind Source3: rpcbind.xml Source4: pmap_set.c BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: libtirpc-devel +BuildRequires: libtirpc-devel >= 1.0.1 BuildRequires: libtool BuildRequires: pkgconfig BuildRequires: tcpd-devel