Accepting request 265252 from home:kukuk:NIS

- Update to upstream 0.2.5 release
- Add symbol versioning to fix symbol conflicts
  (001-symbol-versions-v2.patch), but disable until commited upstream
- Adjust libtirpc-clnt_broadcast_fix.patch and rename to
  002-clnt_broadcast_fix.patch
- Adjust libtirpc-rpc_broadcast_misformed_replies.patch and rename
  to 003-rpc_broadcast_misformed_replies.patch
- Rename libtirpc-getpmaphandle.patch to 004-getpmaphandle.patch
- Adjust libtirpc-bindresvport_blacklist.patch and rename to 
  000-bindresvport_blacklist.patch
- Drop libtirpc-pmap-setunset.patch, not needed anymore
- Apply libtirpc-new-path-rpcbindsock.patch only on openSUSE 13.1
  and later

OBS-URL: https://build.opensuse.org/request/show/265252
OBS-URL: https://build.opensuse.org/package/show/Base:System/libtirpc?expand=0&rev=41
This commit is contained in:
Olaf Kirch 2014-12-18 13:26:10 +00:00 committed by Git OBS Bridge
parent 74e28149ed
commit c3b2cb84b1
10 changed files with 162 additions and 154 deletions

View File

@ -3,11 +3,9 @@ Subject: make libtirpc honor /etc/bindresvport.blacklist
Signed-off-by: Olaf Kirch <okir@suse.de>
Index: libtirpc-0.1.9/src/bindresvport.c
===================================================================
--- libtirpc-0.1.9.orig/src/bindresvport.c
+++ libtirpc-0.1.9/src/bindresvport.c
@@ -40,7 +40,10 @@
--- src/bindresvport.c
+++ src/bindresvport.c 2014/12/15 13:29:13
@@ -39,7 +39,10 @@
#include <netinet/in.h>
@ -18,7 +16,7 @@ Index: libtirpc-0.1.9/src/bindresvport.c
#include <string.h>
#include <unistd.h>
@@ -66,6 +69,80 @@ bindresvport(sd, sin)
@@ -68,6 +71,80 @@
#define ENDPORT (IPPORT_RESERVED - 1)
#define NPORTS (ENDPORT - STARTPORT + 1)
@ -99,17 +97,17 @@ Index: libtirpc-0.1.9/src/bindresvport.c
int
bindresvport_sa(sd, sa)
int sd;
@@ -85,6 +162,9 @@ bindresvport_sa(sd, sa)
@@ -87,6 +164,9 @@
int endport = ENDPORT;
int i;
+ if (!blacklist_read)
+ load_blacklist();
+
if (sa == NULL) {
salen = sizeof(myaddr);
sa = (struct sockaddr *)&myaddr;
@@ -125,12 +205,21 @@ bindresvport_sa(sd, sa)
mutex_lock(&port_lock);
nports = ENDPORT - startport + 1;
@@ -132,12 +212,21 @@
errno = EADDRINUSE;
again:
for (i = 0; i < nports; ++i) {

View File

@ -0,0 +1,113 @@
--- src/libtirpc.map
+++ src/libtirpc.map 2014/12/05 14:33:09
@@ -0,0 +1,99 @@
+TIRPC_1.0 {
+ global:
+ # __*
+ __rpc_createerr; __rpc_dtbsize; __rpc_endconf; __rpc_fd2sockinfo;
+ __rpc_fixup_addr; __rpc_get_a_size; __rpc_get_local_uid;
+ __rpc_get_t_size; __rpc_getconf; __rpc_getconfip; __rpc_nconf2fd;
+ __rpc_nconf2fd_flags; __rpc_nconf2sockinfo; __rpc_rawcombuf;
+ __rpc_seman2socktype; __rpc_setconf; __rpc_sockinfo2netid;
+ __rpc_sockisbound; __rpc_socktype2seman; __rpc_taddr2uaddr_af;
+ __rpc_uaddr2taddr_af; __rpcgettp;
+ # _*
+
+ _authenticate; _null_auth; _rpc_dtablesize; _seterr_reply; _svcauth_none;
+ _svcauth_short; _svcauth_unix;
+
+ # a*
+ authdes_create; authdes_seccreate; authgss_create; authgss_create_default;
+ authgss_free_private_data; authgss_get_private_data; authgss_service;
+ authnone_create; authunix_create; authunix_create_default;
+
+ # b*
+ bindresvport; bindresvport_sa;
+
+ # c*
+ callrpc; clnt_broadcast; clnt_create; clnt_create_timed;
+ clnt_create_vers; clnt_create_vers_timed; clnt_dg_create;
+ clnt_pcreateerror; clnt_perrno; clnt_perror; clnt_raw_create;
+ clnt_spcreateerror; clnt_sperrno; clnt_sperror; clnt_tli_create;
+ clnt_tp_create; clnt_tp_create_timed; clnt_vc_create; clntraw_create;
+ clnttcp_create; clntudp_bufcreate; clntudp_create; clntunix_create;
+
+ # e*
+ endnetconfig; endnetpath; endrpcent;
+
+ # f*
+ freenetconfigent;
+
+ # g*
+ get_myaddress; getnetconfig; getnetconfigent; getnetpath; getrpcent;
+ getrpcport; gss_log_debug; gss_log_hexdump; gss_log_status;
+
+ # n*
+ nc_perror; nc_sperror;
+
+ # p*
+ pmap_getmaps; pmap_getport; pmap_rmtcall; pmap_set; pmap_unset;
+
+ # r*
+ registerrpc; rpc_broadcast; rpc_broadcast_exp; rpc_call; rpc_control;
+ rpc_createerr; rpc_nullproc; rpc_reg; rpcb_getaddr; rpcb_getmaps;
+ rpcb_gettime; rpcb_rmtcall; rpcb_set; rpcb_taddr2uaddr; rpcb_uaddr2taddr;
+ rpcb_unset;
+
+ # s*
+ setnetconfig; setnetpath; setrpcent;
+ svc_auth_reg; svc_create; svc_dg_create; svc_dg_enablecache;
+ svc_exit; svc_fd_create; svc_fdset; svc_getreq; svc_getreq_common;
+ svc_getreq_poll; svc_getreqset; svc_maxfd; svc_raw_create; svc_reg;
+ svc_register; svc_run; svc_sendreply; svc_tli_create; svc_tp_create;
+ svc_unreg; svc_unregister; svc_vc_create; svcerr_auth; svcerr_decode;
+ svcerr_noproc; svcerr_noprog; svcerr_progvers; svcerr_systemerr;
+ svcerr_weakauth; svcfd_create; svcraw_create; svctcp_create;
+ svcudp_bufcreate; svcudp_create; svcunix_create; svcunixfd_create;
+
+ # t*
+ taddr2uaddr;
+
+ # u*
+ uaddr2taddr;
+
+ # x*
+ xdr_accepted_reply; xdr_array; xdr_authdes_cred; xdr_authdes_verf;
+ xdr_authunix_parms; xdr_bool; xdr_bytes; xdr_callhdr; xdr_callmsg;
+ xdr_char; xdr_des_block; xdr_double; xdr_enum; xdr_float; xdr_free;
+ xdr_hyper; xdr_int; xdr_int16_t; xdr_int32_t; xdr_int64_t; xdr_long;
+ xdr_longlong_t; xdr_netbuf; xdr_netobj; xdr_opaque; xdr_opaque_auth;
+ xdr_pmap; xdr_pmaplist; xdr_pmaplist_ptr; xdr_pointer; xdr_reference;
+ xdr_rejected_reply; xdr_replymsg; xdr_rmtcall_args; xdr_rmtcallres;
+ xdr_rpc_gss_cred; xdr_rpc_gss_data; xdr_rpc_gss_init_args;
+ xdr_rpc_gss_init_res; xdr_rpcb; xdr_rpcb_entry; xdr_rpcb_entry_list_ptr;
+ xdr_rpcb_rmtcallargs; xdr_rpcb_rmtcallres; xdr_rpcb_stat;
+ xdr_rpcb_stat_byvers; xdr_rpcblist; xdr_rpcblist_ptr; xdr_rpcbs_addrlist;
+ xdr_rpcbs_addrlist_ptr; xdr_rpcbs_proc; xdr_rpcbs_rmtcalllist;
+ xdr_rpcbs_rmtcalllist_ptr; xdr_short; xdr_string; xdr_u_char; xdr_u_hyper;
+ xdr_u_int; xdr_u_int16_t; xdr_u_int32_t; xdr_u_int64_t; xdr_u_long;
+ xdr_u_longlong_t; xdr_u_short; xdr_union; xdr_vector; xdr_void;
+ xdr_wrapstring; xdrmem_create; xdrrec_create; xdrrec_endofrecord;
+ xdrrec_eof; xdrrec_skiprecord; xdrstdio_create; xprt_register;
+ xprt_unregister;
+
+ local:
+ *;
+};
+TIRPC_PRIVATE {
+ global:
+ __libc_clntudp_bufcreate;
+ # private, but used by rpcbind:
+ __svc_clean_idle; svc_auth_none;
+};
--- src/Makefile.am
+++ src/Makefile.am 2014/12/05 14:38:11
@@ -41,7 +41,7 @@
# release number of your package. This is an abuse that only fosters
# misunderstanding of the purpose of library versions."
#
-libtirpc_la_LDFLAGS = -lpthread -version-info 1:10:0
+libtirpc_la_LDFLAGS = -lpthread -version-info 1:10:0 -Wl,--version-script=$(srcdir)/libtirpc.map
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 \

View File

@ -17,8 +17,8 @@ diff --git a/src/clnt_bcast.c b/src/clnt_bcast.c
index aa2b8f2..899eb76 100644
--- a/src/clnt_bcast.c
+++ b/src/clnt_bcast.c
@@ -607,9 +607,11 @@ rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp,
#endif
@@ -588,9 +588,11 @@
LIBTIRPC_DEBUG(3, ("rpc_broadcast_exp: uaddr %s\n", uaddrp));
np = uaddr2taddr(
fdlist[i].nconf, uaddrp);
- done = (*eachresult)(resultsp,

View File

@ -1,4 +1,3 @@
commit 17619288497d76ade1671f0adbda682548d026d5
Author: Olaf Kirch <okir@suse.de>
Date: Thu Nov 13 10:24:39 2008 +0100
@ -14,11 +13,9 @@ Date: Thu Nov 13 10:24:39 2008 +0100
Signed-off-by: Olaf Kirch <okir@suse.de>
diff --git a/src/clnt_bcast.c b/src/clnt_bcast.c
index 899eb76..55efc9d 100644
--- a/src/clnt_bcast.c
+++ b/src/clnt_bcast.c
@@ -227,6 +227,39 @@ __rpc_broadenable(int af, int s, struct broadif *bip)
@@ -222,6 +222,39 @@
return 0;
}
@ -58,8 +55,8 @@ index 899eb76..55efc9d 100644
enum clnt_stat
rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp,
@@ -607,6 +640,13 @@ rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp,
#endif
@@ -588,6 +621,13 @@
LIBTIRPC_DEBUG(3, ("rpc_broadcast_exp: uaddr %s\n", uaddrp));
np = uaddr2taddr(
fdlist[i].nconf, uaddrp);
+ /* Some misguided rpcbind implemenations

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:68374f9ac6ddcf4a4b1a0680c691160e05533563eb43b1c297e9495ad4a5b4c5
size 164622

3
libtirpc-0.2.5.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:62f9de7c2c8686c568757730e1fef66502a0e00d6cacf33546d0267984e002db
size 459094

View File

@ -1,120 +0,0 @@
commit 30feadb3ae5a8d001aabc44f8ddad44298ec61a2
Author: Olaf Kirch <okir@suse.de>
Date: Mon Aug 23 14:36:13 2010 +0200
pmap_set/unset: allow compat functions to work with old-style portmap
This change fixes a bug when running applications compiled against
libtirpc on a host with old-style portmap. Without this change, the
pmap_set/pmap_unset compatibility functions will actually be mapped
to a RPCB_SET/UNSET call. If the server does not support anything more
recent than PMAP, the operations will fail completely.
This fix makes pmap_set/unset try the old portmapper functions
first, and if those fail, try to fall back to the new rpcbind
interface.
Signed-off-by: Olaf Kirch <okir@suse.de>
diff --git a/src/pmap_clnt.c b/src/pmap_clnt.c
index 1d5d153..24cf94a 100644
--- a/src/pmap_clnt.c
+++ b/src/pmap_clnt.c
@@ -58,6 +58,10 @@ pmap_set(u_long program, u_long version, int protocol, int port)
struct netconfig *nconf;
char buf[32];
+#ifdef PORTMAP
+ if (__pmap_set(program, version, protocol, port))
+ return (TRUE);
+#endif
if ((protocol != IPPROTO_UDP) && (protocol != IPPROTO_TCP)) {
return (FALSE);
}
@@ -89,6 +93,11 @@ pmap_unset(u_long program, u_long version)
bool_t udp_rslt = FALSE;
bool_t tcp_rslt = FALSE;
+#ifdef PORTMAP
+ if (__pmap_set(program, version, IPPROTO_UDP, 0)
+ && __pmap_set(program, version, IPPROTO_TCP, 0))
+ return (TRUE);
+#endif
nconf = __rpc_getconfip("udp");
if (nconf != NULL) {
udp_rslt = rpcb_unset((rpcprog_t)program, (rpcvers_t)version,
diff --git a/src/rpc_com.h b/src/rpc_com.h
index 38c2cfe..0a20a01 100644
--- a/src/rpc_com.h
+++ b/src/rpc_com.h
@@ -86,6 +86,9 @@ bool_t __xdrrec_getrec(XDR *, enum xprt_stat *, bool_t);
void __xprt_unregister_unlocked(SVCXPRT *);
void __xprt_set_raddr(SVCXPRT *, const struct sockaddr_storage *);
+#ifdef PORTMAP
+bool_t __pmap_set(rpcprog_t, rpcvers_t, int protocol, int port);
+#endif
SVCXPRT **__svc_xports;
int __svc_maxrec;
diff --git a/src/rpcb_clnt.c b/src/rpcb_clnt.c
index 531c619..9562646 100644
--- a/src/rpcb_clnt.c
+++ b/src/rpcb_clnt.c
@@ -476,6 +476,55 @@ getpmaphandle(nconf, hostname, tgtaddr)
#define IN4_LOCALHOST_STRING "127.0.0.1"
#define IN6_LOCALHOST_STRING "::1"
+#ifdef PORTMAP
+/*
+ * Perform a PMAP_SET or PMAP_UNSET call to the
+ * local rpcbind/portmap service.
+ */
+bool_t
+__pmap_set(program, version, protocol, port)
+ rpcprog_t program;
+ rpcvers_t version;
+ int protocol;
+ int port;
+{
+ CLIENT *client;
+ rpcproc_t pmapproc;
+ struct pmap pmapparms;
+ bool_t rslt = FALSE;
+ enum clnt_stat clnt_st;
+
+ /* Arguments should already have been checked by caller */
+
+ pmapproc = port? PMAPPROC_SET : PMAPPROC_UNSET;
+ pmapparms.pm_prog = program;
+ pmapparms.pm_vers = version;
+ pmapparms.pm_prot = protocol;
+ pmapparms.pm_port = port;
+
+ client = getpmaphandle(NULL, IN4_LOCALHOST_STRING, NULL);
+ if (client == NULL)
+ return (FALSE);
+
+ clnt_st = CLNT_CALL(client, pmapproc,
+ (xdrproc_t) xdr_pmap, (caddr_t)(void *) &pmapparms,
+ (xdrproc_t) xdr_bool, (caddr_t)(void *) &rslt,
+ tottimeout);
+
+ if (clnt_st == RPC_SUCCESS)
+ return rslt;
+
+ if (clnt_st != RPC_PROGVERSMISMATCH &&
+ clnt_st != RPC_PROGUNAVAIL) {
+ rpc_createerr.cf_stat = RPC_PMAPFAILURE;
+ clnt_geterr(client, &rpc_createerr.cf_error);
+ return (FALSE);
+ }
+
+ return (TRUE);
+}
+#endif
+
/*
* This routine will return a client handle that is connected to the local
* rpcbind. Returns NULL on error and free's everything.

View File

@ -1,3 +1,20 @@
-------------------------------------------------------------------
Mon Dec 15 14:47:58 CET 2014 - kukuk@suse.de
- Update to upstream 0.2.5 release
- Add symbol versioning to fix symbol conflicts
(001-symbol-versions-v2.patch), but disable until commited upstream
- Adjust libtirpc-clnt_broadcast_fix.patch and rename to
002-clnt_broadcast_fix.patch
- Adjust libtirpc-rpc_broadcast_misformed_replies.patch and rename
to 003-rpc_broadcast_misformed_replies.patch
- Rename libtirpc-getpmaphandle.patch to 004-getpmaphandle.patch
- Adjust libtirpc-bindresvport_blacklist.patch and rename to
000-bindresvport_blacklist.patch
- Drop libtirpc-pmap-setunset.patch, not needed anymore
- Apply libtirpc-new-path-rpcbindsock.patch only on openSUSE 13.1
and later
-------------------------------------------------------------------
Fri Jan 31 15:56:16 UTC 2014 - okir@suse.com

View File

@ -16,12 +16,12 @@
#
%define tarversion 0.2.4-rc2
%define tarversion 0.2.5
Name: libtirpc
# src/crypt_client.c tirpc/spinlock.h and tirpc/rpcsvc/crypt.x have the BSD
# advertising clause
Version: 0.2.3
Version: 0.2.5
Release: 0
Summary: Transport Independent RPC Library
License: BSD-4-Clause
@ -37,13 +37,14 @@ Url: http://sourceforge.net/projects/libtirpc/
# http://downloads.sourceforge.net/project/%{name}/%{name}/%{version}/%{name}-%{tarversion}.tar.bz2
Source: %{name}-%{tarversion}.tar.bz2
Source1: baselibs.conf
Patch21: libtirpc-clnt_broadcast_fix.patch
Patch22: libtirpc-rpc_broadcast_misformed_replies.patch
Patch31: libtirpc-getpmaphandle.patch
Patch32: libtirpc-pmap-setunset.patch
Patch34: libtirpc-bindresvport_blacklist.patch
Patch0: 000-bindresvport_blacklist.patch
Patch1: 001-symbol-versions-v2.patch
Patch2: 002-clnt_broadcast_fix.patch
Patch3: 003-rpc_broadcast_misformed_replies.patch
Patch4: 004-getpmaphandle.patch
Patch35: libtirpc-clntunix_create.patch
Patch36: libtirpc-misc-segfaults.patch
# Patch37 is only needed on openSUSE >= 13.1, SLE >= 12
Patch37: libtirpc-new-path-rpcbindsock.patch
Patch38: libtirpc-taddr2uaddr-local.patch
Patch39: libtirpc-getbroadifs-crash.patch
@ -82,14 +83,16 @@ TCP over IPv4
%prep
%setup -q -n %name-%tarversion
%patch21 -p1
%patch22 -p1
%patch31 -p1
%patch32 -p1
%patch34 -p1
%patch0 -p0
#%patch1 -p0
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch35 -p1
%patch36 -p1
%if 0%{suse_version} >= 1310
%patch37 -p1
%endif
%patch38 -p1
%patch39 -p1