SHA256
1
0
forked from pool/libtirpc

Accepting request 305737 from home:kukuk:NIS

- Fix HAVE_AUTHDES/HAVE_GSSAPI in public header files
  (001-tirpc-features.patch)

- Update to official release 0.3.0. authdes was disabled by default
  upstream.
- Following patches were merged:
  - 001-symbol-versions-v5.patch
  - 003-add-des_crypt.diff
- Remove 002-old-automake.patch, not needed anymore

- Update 001-symbol-versions-v4.patch with
  001-symbol-versions-v5.patch: Add --disable-symvers option

- Update 003-add-des_crypt.diff, fix unresolved des functions

- Update to git
- Add 003-add-des_crypt.diff to fix unresolved *_crypt() functions

- Disable gssapi for SLE11, kerberos version is too old

- rpc/rpc.h requires now indirectly gssapi.h from krb5-devel

- Update to current git.
- The following patches were accepted upstream:
  - 003-xdr_h-fix.patch
  - 005-disable-rpcent.patch
  - 006-no-libnsl.patch
  - patch1_7.diff
  - patch2_7.diff
  - patch3_7.diff

OBS-URL: https://build.opensuse.org/request/show/305737
OBS-URL: https://build.opensuse.org/package/show/Base:System/libtirpc?expand=0&rev=43
This commit is contained in:
Cristian Rodríguez 2015-05-07 19:52:27 +00:00 committed by Git OBS Bridge
parent c3b2cb84b1
commit 167c8f44ce
17 changed files with 360 additions and 558 deletions

View File

@ -3,10 +3,10 @@ Subject: make libtirpc honor /etc/bindresvport.blacklist
Signed-off-by: Olaf Kirch <okir@suse.de>
--- src/bindresvport.c
+++ src/bindresvport.c 2014/12/15 13:29:13
--- src/bindresvport.c 2015-04-23 21:22:56.986448281 +0200
+++ src/bindresvport.c 2015-04-23 21:48:06.501561665 +0200
@@ -39,7 +39,10 @@
#include <netdb.h>
#include <netinet/in.h>
+#include <stdio.h>

View File

@ -1,113 +0,0 @@
--- 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 \

99
001-tirpc-features.patch Normal file
View File

@ -0,0 +1,99 @@
diff --git a/Makefile.am b/Makefile.am
index 2bf725c..2bce3b0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,9 +4,11 @@ ACLOCAL_AMFLAGS = -I m4
noinst_HEADERS = tirpc/reentrant.h \
tirpc/getpeereid.h \
tirpc/libc_private.h \
- tirpc/un-namespace.h
+ tirpc/un-namespace.h \
+ tirpc/tirpc-features.h.in
nobase_include_HEADERS = tirpc/netconfig.h \
+ tirpc/tirpc-features.h \
tirpc/rpcsvc/crypt.x \
tirpc/rpcsvc/crypt.h \
tirpc/rpc/xdr.h \
diff --git a/configure.ac b/configure.ac
index 711b054..290c635 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,6 +10,7 @@ AC_ARG_ENABLE(gssapi,
AM_CONDITIONAL(GSS, test "x$enable_gssapi" = xyes)
if test "x$enable_gssapi" = xyes; then
+ AC_DEFINE([HAVE_GSSAPI], [1], [Define to 1 if GSSAPI is enabled])
GSSAPI_CFLAGS=`krb5-config --cflags gssapi`
GSSAPI_LIBS=`krb5-config --libs gssapi`
AC_SUBST([GSSAPI_CFLAGS])
@@ -41,7 +42,7 @@ AC_ARG_ENABLE(symvers,
AM_CONDITIONAL(SYMVERS, test "x$enable_symvers" = xyes)
AC_PROG_CC
-AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_HEADERS([config.h tirpc/tirpc-features.h])
AC_PROG_LIBTOOL
AC_HEADER_DIRENT
AC_PREFIX_DEFAULT(/usr)
diff --git a/tirpc/rpc/rpc.h b/tirpc/rpc/rpc.h
index 1dbb391..8f37454 100644
--- a/tirpc/rpc/rpc.h
+++ b/tirpc/rpc/rpc.h
@@ -35,6 +35,8 @@
#ifndef _TIRPC_RPC_H
#define _TIRPC_RPC_H
+#include <tirpc-features.h>
+
#include <rpc/types.h> /* some typedefs */
#include <sys/socket.h>
#include <netinet/in.h>
@@ -60,7 +62,7 @@
#include <rpc/auth_des.h> /* protocol for des style cred */
#endif /* HAVE_AUTHDES */
-#ifdef HAVE_RPCSEC_GSS
+#ifdef HAVE_GSSAPI
#include <rpc/auth_gss.h> /* RPCSEC_GSS */
#endif
diff --git a/tirpc/rpc/svc_auth.h b/tirpc/rpc/svc_auth.h
index 44b38bf..b308d2b 100644
--- a/tirpc/rpc/svc_auth.h
+++ b/tirpc/rpc/svc_auth.h
@@ -41,6 +41,10 @@
#ifndef _RPC_SVC_AUTH_H
#define _RPC_SVC_AUTH_H
+#include <tirpc-features.h>
+
+#ifdef HAVE_GSSAPI
+
#include <rpc/rpcsec_gss.h>
typedef struct {
@@ -51,6 +55,8 @@ typedef struct {
u_int seq_num;
} svc_rpc_gss_parms_t;
+#endif /* HAVE_GSSAPI */
+
/*
* Interface to server-side authentication flavors.
*/
diff --git a/tirpc/tirpc-features.h.in b/tirpc/tirpc-features.h.in
index e69de29..72e18bc 100644
--- a/tirpc/tirpc-features.h.in
+++ b/tirpc/tirpc-features.h.in
@@ -0,0 +1,10 @@
+#ifndef _TIRPC_FEATURES_H
+#define _TIRPC_FEATURES_H
+
+/* Define to 1 if DES authentication is enabled */
+#undef HAVE_AUTHDES
+
+/* Define to 1 if GSSAPI is enabled */
+#undef HAVE_GSSAPI
+
+#endif /* _TIRPC_FEATURES_H */

View File

@ -1,34 +0,0 @@
commit 8d096a0572b955835f7f64f267a29047091e0a8e
Author: Olaf Kirch <okir@suse.de>
Date: Wed Nov 12 16:10:53 2008 +0100
Fix a bug in clnt broadcast
Before calling the replyproc function on a broadcast reply,
we convert the server-provided address using uaddr2taddr.
This may fail (eg if the server provided a garbage address),
and return NULL. In this case, we should not call the replyproc
function - because the caller expects the address netbuf to
be a valid pointer, rather than NULL.
Signed-off-by: Olaf Kirch <okir@suse.de>
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
@@ -588,9 +588,11 @@
LIBTIRPC_DEBUG(3, ("rpc_broadcast_exp: uaddr %s\n", uaddrp));
np = uaddr2taddr(
fdlist[i].nconf, uaddrp);
- done = (*eachresult)(resultsp,
- np, fdlist[i].nconf);
- free(np);
+ if (np != NULL) {
+ done = (*eachresult)(resultsp,
+ np, fdlist[i].nconf);
+ free(np);
+ }
#ifdef PORTMAP
}
#endif /* PORTMAP */

View File

@ -1,71 +0,0 @@
Author: Olaf Kirch <okir@suse.de>
Date: Thu Nov 13 10:24:39 2008 +0100
rpc_broadcast: handle misformed rpcbind replies
Some rpcbind implementations seem to return IPv6 uaddrs
in response to an IPv4 broadcast (which is probably due
to their using a single v6 socket to handle both v6 and
v4 requests).
We can either discard these replies, or fix them up silently.
Here's a patch that implements the latter.
Signed-off-by: Olaf Kirch <okir@suse.de>
--- a/src/clnt_bcast.c
+++ b/src/clnt_bcast.c
@@ -222,6 +222,39 @@
return 0;
}
+/*
+ * Some rpcbind implementations use an IPv6 socket to serve both
+ * IPv4 and IPv6 messages, but neglect to check for the caller's
+ * address family when sending broadcast replies. These rpcbind
+ * implementations return an IPv6 address in reply to an IPv4
+ * broadcast. We can either ignore them, or try to patch them up.
+ */
+static struct netbuf *
+__ipv6v4_fixup(struct sockaddr_storage *ss, const char *uaddr)
+{
+ struct sockaddr_in sin;
+ struct netbuf *np;
+
+ /* ss is the remote rpcbind server's address */
+ if (ss->ss_family != AF_INET)
+ return NULL;
+ memcpy(&sin, ss, sizeof(sin));
+
+ np = __rpc_uaddr2taddr_af(AF_INET6, uaddr);
+ if (np == NULL)
+ return NULL;
+
+ /* Overwrite the port with that of the service we
+ * wanted to talk to. */
+ sin.sin_port = ((struct sockaddr_in6 *) np)->sin6_port;
+
+ /* We know netbuf holds a sockaddr_in6, so it can easily
+ * hold a sockaddr_in as well. */
+ memcpy(np->buf, &sin, sizeof(sin));
+ np->len = sizeof(sin);
+
+ return np;
+}
enum clnt_stat
rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp,
@@ -588,6 +621,13 @@
LIBTIRPC_DEBUG(3, ("rpc_broadcast_exp: uaddr %s\n", uaddrp));
np = uaddr2taddr(
fdlist[i].nconf, uaddrp);
+ /* Some misguided rpcbind implemenations
+ * seem to return an IPv6 uaddr in IPv4
+ * responses. */
+ if (np == NULL)
+ np = __ipv6v4_fixup(
+ &fdlist[i].raddr,
+ uaddrp);
if (np != NULL) {
done = (*eachresult)(resultsp,
np, fdlist[i].nconf);

View File

@ -1,101 +0,0 @@
commit 258824b705df18d171eaf072cfda692504e3649e
Author: Olaf Kirch <okir@suse.de>
Date: Mon Aug 23 12:58:41 2010 +0200
Introduce new helper function getpmaphandle
This moves some code for creation of PMAP handles out of the getaddr
code and into a function of its own.
Signed-off-by: Olaf Kirch <okir@suse.de>
diff --git a/src/rpcb_clnt.c b/src/rpcb_clnt.c
index a800128..962d9c7 100644
--- a/src/rpcb_clnt.c
+++ b/src/rpcb_clnt.c
@@ -434,6 +434,44 @@ out_err:
return (client);
}
+/*
+ * Create a PMAP client handle.
+ */
+static CLIENT *
+getpmaphandle(nconf, hostname, tgtaddr)
+ const struct netconfig *nconf;
+ const char *hostname;
+ char **tgtaddr;
+{
+ CLIENT *client = NULL;
+ rpcvers_t pmapvers = 2;
+
+ /*
+ * Try UDP only - there are some portmappers out
+ * there that use UDP only.
+ */
+ if (nconf == NULL || strcmp(nconf->nc_proto, NC_TCP) == 0) {
+ struct netconfig *newnconf;
+
+ if ((newnconf = getnetconfigent("udp")) == NULL) {
+ rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
+ return NULL;
+ }
+ client = getclnthandle(hostname, newnconf, tgtaddr);
+ freenetconfigent(newnconf);
+ } else if (strcmp(nconf->nc_proto, NC_UDP) == 0) {
+ if (strcmp(nconf->nc_protofmly, NC_INET) != 0)
+ return NULL;
+ client = getclnthandle(hostname, nconf, tgtaddr);
+ }
+
+ /* Set version */
+ if (client != NULL)
+ CLNT_CONTROL(client, CLSET_VERS, (char *)&pmapvers);
+
+ return client;
+}
+
/* XXX */
#define IN4_LOCALHOST_STRING "127.0.0.1"
#define IN6_LOCALHOST_STRING "::1"
@@ -770,34 +808,20 @@ __rpcb_findaddr_timed(program, version, nconf, host, clpp, tp)
if (strcmp(nconf->nc_protofmly, NC_INET) == 0) {
u_short port = 0;
struct netbuf remote;
- rpcvers_t pmapvers = 2;
struct pmap pmapparms;
- /*
- * Try UDP only - there are some portmappers out
- * there that use UDP only.
- */
- if (strcmp(nconf->nc_proto, NC_TCP) == 0) {
- struct netconfig *newnconf;
-
- if ((newnconf = getnetconfigent("udp")) == NULL) {
- rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
- return (NULL);
- }
- client = getclnthandle(host, newnconf, &parms.r_addr);
- freenetconfigent(newnconf);
- } else if (strcmp(nconf->nc_proto, NC_UDP) == 0)
- client = getclnthandle(host, nconf, &parms.r_addr);
- else
+ if (strcmp(nconf->nc_proto, NC_UDP) != 0
+ && strcmp(nconf->nc_proto, NC_TCP) != 0)
goto try_rpcbind;
+
+ client = getpmaphandle(nconf, host, &parms.r_addr);
if (client == NULL)
return (NULL);
/*
- * Set version and retry timeout.
+ * Set retry timeout.
*/
CLNT_CONTROL(client, CLSET_RETRY_TIMEOUT, (char *)&rpcbrmttime);
- CLNT_CONTROL(client, CLSET_VERS, (char *)&pmapvers);
pmapparms.pm_prog = program;
pmapparms.pm_vers = version;

View File

@ -0,0 +1,17 @@
diff --git a/doc/netconfig b/doc/netconfig
index effc67e..85c24da 100644
--- a/doc/netconfig
+++ b/doc/netconfig
@@ -10,10 +10,10 @@
# The <device> and <nametoaddr_libs> fields are always empty in this
# implementation.
#
-udp tpi_clts v inet udp - -
-tcp tpi_cots_ord v inet tcp - -
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 - -
rawip tpi_raw - inet - - -
local tpi_cots_ord - loopback - - -
unix tpi_cots_ord - loopback - - -

View File

@ -0,0 +1,32 @@
Behebt das das Problem mit svc_register?
Gruß
Olaf
src/rpc_generic.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/rpc_generic.c b/src/rpc_generic.c
index 6148830..4fc882a 100644
--- a/src/rpc_generic.c
+++ b/src/rpc_generic.c
@@ -250,8 +250,7 @@ __rpc_getconfip(nettype)
return (NULL);
}
while ((nconf = getnetconfig(confighandle)) != NULL) {
- if (strcmp(nconf->nc_protofmly, NC_INET) == 0 ||
- strcmp(nconf->nc_protofmly, NC_INET6) == 0) {
+ if (strcmp(nconf->nc_protofmly, NC_INET) == 0) {
if (strcmp(nconf->nc_proto, NC_TCP) == 0 &&
netid_tcp == NULL) {
netid_tcp = strdup(nconf->nc_netid);
--
What is tolerance? It is the consequence of humanity. -- Voltaire
--------------------------------------------
Olaf Kirch - Director SUSE Linux Enterprise Core; R&D (okir@suse.com)
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu,
Graham Norton, HRB 21284 (AG Nürnberg)

View File

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

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

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

View File

@ -1,70 +0,0 @@
commit 79bf7950d8c8bc9d323887ba0e5fa7555aa6644a
Author: Olaf Kirch <okir@suse.de>
Date: Tue Feb 8 10:21:16 2011 +0100
Fix a crash in clntunix_create
Programs using clntunix_create would abort because glibc detected an
attempt to free a bad pointer. It turns out that clntunix_create
has two bugs:
- it sets up a struct netbuf to hold the sockaddr_un passed
into the function, but instead of copying the data, it
just assigns the sockaddr pointer - and eventually tries to
free that pointer.
- when setting up the netbuf, it uses sizeof(raddr) instead
of sizeof(*raddr).
Instead of doing the trivial fixes, I changed the function to use
the __rpc_set_netbuf utility function. While I was at it, I removed
an unused local variable.
Signed-off-by: Olaf Kirch <okir@suse.de>
---
src/rpc_soc.c | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
Index: libtirpc-0.2.4-rc2/src/rpc_soc.c
===================================================================
--- libtirpc-0.2.4-rc2.orig/src/rpc_soc.c
+++ libtirpc-0.2.4-rc2/src/rpc_soc.c
@@ -564,16 +564,12 @@ clntunix_create(raddr, prog, vers, sockp
u_int sendsz;
u_int recvsz;
{
- struct netbuf *svcaddr;
- CLIENT *cl;
+ struct netbuf svcaddr;
+ CLIENT *cl = NULL;
int len;
- cl = NULL;
- svcaddr = NULL;
- if (((svcaddr = malloc(sizeof(struct netbuf))) == NULL ) ||
- ((svcaddr->buf = malloc(sizeof(struct sockaddr_un))) == NULL)) {
- if (svcaddr != NULL)
- free(svcaddr);
+ memset(&svcaddr, 0, sizeof(svcaddr));
+ if (__rpc_set_netbuf(&svcaddr, raddr, sizeof(*raddr)) == NULL) {
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
rpc_createerr.cf_error.re_errno = errno;
return(cl);
@@ -590,14 +586,10 @@ clntunix_create(raddr, prog, vers, sockp
goto done;
}
}
- svcaddr->buf = raddr;
- svcaddr->len = sizeof(raddr);
- svcaddr->maxlen = sizeof (struct sockaddr_un);
- cl = clnt_vc_create(*sockp, svcaddr, prog,
+ cl = clnt_vc_create(*sockp, &svcaddr, prog,
vers, sendsz, recvsz);
done:
- free(svcaddr->buf);
- free(svcaddr);
+ free(svcaddr.buf);
return(cl);
}

View File

@ -1,33 +0,0 @@
From 5aa9bf181ec1ce900ca4e84c62e3b31346478626 Mon Sep 17 00:00:00 2001
From: Olaf Kirch <okir@suse.de>
Date: Fri, 31 Jan 2014 16:37:25 +0100
Subject: [PATCH] Prevent a segfault of "rpcinfo -b" on systems with tuntap
devices
Linux tuntap devices and other virtual network devices, if not
configured, will be reported by getifaddrs() with a NULL ifa_addr
pointer. __rpc_getifaddrs would trip over that, because it derefenced
the ifa_addr pointer without checking.
Signed-off-by: Olaf Kirch <okir@suse.de>
---
src/clnt_bcast.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/clnt_bcast.c b/src/clnt_bcast.c
index 1055545..6ab0851 100644
--- a/src/clnt_bcast.c
+++ b/src/clnt_bcast.c
@@ -143,7 +143,8 @@ __rpc_getbroadifs(int af, int proto, int socktype, broadlist_t *list)
return 0;
for (ifap = ifp; ifap != NULL; ifap = ifap->ifa_next) {
- if (ifap->ifa_addr->sa_family != af ||
+ if (ifap->ifa_addr == NULL || /* happens for eg tuntap devices */
+ ifap->ifa_addr->sa_family != af ||
!(ifap->ifa_flags & IFF_UP))
continue;
bip = (struct broadif *)malloc(sizeof *bip);
--
1.7.12.4

View File

@ -1,68 +0,0 @@
This patch fixes various unexpected segfaults caused by invoking rpcb_* functions with
NULL arguments.
diff -u -ur libtirpc-0.2.4-rc2/src/rpcb_clnt.c libtirpc-0.2.4-rc2/src/rpcb_clnt.c
--- libtirpc-0.2.4-rc2/src/rpcb_clnt.c 2014-01-09 09:09:59.000000000 +0100
+++ libtirpc-0.2.4-rc2/src/rpcb_clnt.c 2014-01-09 11:13:01.000000000 +0100
@@ -287,6 +287,18 @@
struct address_cache *ad_cache;
char *tmpaddr;
+ if (nconf == NULL) {
+ rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
+ return NULL;
+ }
+
+ if (nconf->nc_protofmly != NULL &&
+ strcmp(nconf->nc_protofmly, NC_LOOPBACK) != 0 &&
+ host == NULL) {
+ rpc_createerr.cf_stat = RPC_UNKNOWNHOST;
+ return NULL;
+ }
+
/* VARIABLES PROTECTED BY rpcbaddr_cache_lock: ad_cache */
/* Get the address of the rpcbind. Check cache first */
@@ -296,6 +308,7 @@
addr_to_delete.len = 0;
rwlock_rdlock(&rpcbaddr_cache_lock);
ad_cache = NULL;
+
if (host != NULL)
ad_cache = check_cache(host, nconf->nc_netid);
if (ad_cache != NULL) {
@@ -303,7 +316,7 @@
client = clnt_tli_create(RPC_ANYFD, nconf, addr,
(rpcprog_t)RPCBPROG, (rpcvers_t)RPCBVERS4, 0, 0);
if (client != NULL) {
- if (targaddr)
+ if (targaddr && ad_cache->ac_uaddr)
*targaddr = strdup(ad_cache->ac_uaddr);
rwlock_unlock(&rpcbaddr_cache_lock);
return (client);
@@ -353,9 +366,11 @@
} else {
struct sockaddr_un sun;
- *targaddr = malloc(sizeof(sun.sun_path));
- strncpy(*targaddr, _PATH_RPCBINDSOCK,
- sizeof(sun.sun_path));
+ if (targaddr) {
+ *targaddr = malloc(sizeof(sun.sun_path));
+ strncpy(*targaddr, _PATH_RPCBINDSOCK,
+ sizeof(sun.sun_path));
+ }
return (client);
}
} else {
@@ -402,7 +417,8 @@
if (client) {
tmpaddr = targaddr ? taddr2uaddr(nconf, &taddr) : NULL;
- add_cache(host, nconf->nc_netid, &taddr, tmpaddr);
+ if (host)
+ add_cache(host, nconf->nc_netid, &taddr, tmpaddr);
if (targaddr)
*targaddr = tmpaddr;
break;

View File

@ -1,42 +0,0 @@
taddr2uaddr would return trailing garbage for AF_LOCAL addresses
taddr2uaddr assumed that the sun_path field of an AF_LOCAL address
was always NULL terminated, but that is not necessarily the case,
especially if the buffer was allocated using the correct SUN_LEN().
Signed-off-by: Olaf Kirch <okir@suse.de>
---
src/rpc_generic.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
Index: libtirpc-0.2.4-rc2/src/rpc_generic.c
===================================================================
--- libtirpc-0.2.4-rc2.orig/src/rpc_generic.c
+++ libtirpc-0.2.4-rc2/src/rpc_generic.c
@@ -608,6 +608,7 @@ __rpc_taddr2uaddr_af(int af, const struc
struct sockaddr_in6 *sin6;
char namebuf6[INET6_ADDRSTRLEN];
#endif
+ int path_len;
u_int16_t port;
if (nbuf->len <= 0)
@@ -638,13 +639,12 @@ __rpc_taddr2uaddr_af(int af, const struc
#endif
case AF_LOCAL:
sun = nbuf->buf;
- /* if (asprintf(&ret, "%.*s", (int)(sun->sun_len -
- offsetof(struct sockaddr_un, sun_path)),
- sun->sun_path) < 0)*/
- if (asprintf(&ret, "%.*s", (int)(sizeof(*sun) -
- offsetof(struct sockaddr_un, sun_path)),
- sun->sun_path) < 0)
+ path_len = nbuf->len - offsetof(struct sockaddr_un, sun_path);
+ if (path_len < 0)
+ return NULL;
+
+ if (asprintf(&ret, "%.*s", path_len, sun->sun_path) < 0)
return (NULL);
break;
default:

View File

@ -1,3 +1,110 @@
-------------------------------------------------------------------
Thu May 7 13:50:16 CEST 2015 - kukuk@suse.de
- Fix HAVE_AUTHDES/HAVE_GSSAPI in public header files
(001-tirpc-features.patch)
-------------------------------------------------------------------
Wed May 6 22:54:38 CEST 2015 - kukuk@suse.de
- Update to official release 0.3.0. authdes was disabled by default
upstream.
- Following patches were merged:
- 001-symbol-versions-v5.patch
- 003-add-des_crypt.diff
- Remove 002-old-automake.patch, not needed anymore
-------------------------------------------------------------------
Mon May 4 11:41:21 CEST 2015 - kukuk@suse.de
- Update 001-symbol-versions-v4.patch with
001-symbol-versions-v5.patch: Add --disable-symvers option
-------------------------------------------------------------------
Thu Apr 30 18:14:30 CEST 2015 - kukuk@suse.de
- Update 003-add-des_crypt.diff, fix unresolved des functions
-------------------------------------------------------------------
Thu Apr 30 17:11:28 CEST 2015 - kukuk@suse.de
- Update to git
- Add 003-add-des_crypt.diff to fix unresolved *_crypt() functions
-------------------------------------------------------------------
Thu Apr 30 13:12:30 CEST 2015 - kukuk@suse.de
- Disable gssapi for SLE11, kerberos version is too old
-------------------------------------------------------------------
Thu Apr 30 12:56:09 CEST 2015 - kukuk@suse.de
- rpc/rpc.h requires now indirectly gssapi.h from krb5-devel
-------------------------------------------------------------------
Thu Apr 30 11:47:42 CEST 2015 - kukuk@suse.de
- Update to current git.
- The following patches were accepted upstream:
- 003-xdr_h-fix.patch
- 005-disable-rpcent.patch
- 006-no-libnsl.patch
- patch1_7.diff
- patch2_7.diff
- patch3_7.diff
- patch7_7.diff: removed, rejected upstream
- 001-symbol-versions-v3.patch: replace with 001-symbol-versions-v4.patch
-------------------------------------------------------------------
Fri Apr 24 14:57:04 CEST 2015 - kukuk@suse.de
- Add the following patches from the libtirpc-devel mailing list:
- patch1_7.diff (remove wrong config.h.in)
- patch2_7.diff (fix function name of yp_check)
- patch3_7.diff (make sure config.h is included)
- patch6_7.diff (use getaddrinfo in getrpcport)
- patch7_7.diff (remove prototypes from headers we don't supply)
-------------------------------------------------------------------
Fri Apr 24 13:34:30 CEST 2015 - kukuk@suse.de
- Add following patches:
- 003-xdr_h-fix.patch (fix wrong defines using xdr_u_int32)
- 005-disable-rpcent.patch (use rpcent functions from glibc)
- 006-no-libnsl.patch (don't link against libnsl)
-------------------------------------------------------------------
Thu Apr 23 21:55:29 CEST 2015 - kukuk@suse.de
- Update to 0.2.5.git from 20150423
- following patches are accepted upstream:
- 003-rpc_broadcast_misformed_replies.patch
- libtirpc-misc-segfaults.patch
- replace 001-symbol-versions-v2.patch with
001-symbol-versions-v3.patch
- enable symbol versioning patch
-------------------------------------------------------------------
Fri Dec 19 14:20:15 CET 2014 - kukuk@suse.de
- 004-netconfig-prefer-IPv6.patch: Prever IPv6 over IPv4 (configured
in /etc/netconfig)
-------------------------------------------------------------------
Fri Dec 19 13:37:49 CET 2014 - kukuk@suse.de
- 002-old-automake.patch: make buildable on old systems
-------------------------------------------------------------------
Wed Dec 17 16:26:51 CET 2014 - kukuk@suse.de
- Update to 0.2.5.git from 20141217
- following patches are accepted upstream:
- 002-clnt_broadcast_fix.patch
- 004-getpmaphandle.patch
- libtirpc-clntunix_create.patch
- libtirpc-getbroadifs-crash.patch
-------------------------------------------------------------------
Mon Dec 15 14:47:58 CET 2014 - kukuk@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package libtirpc
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,12 +16,12 @@
#
%define tarversion 0.2.5
%define tarversion 0.3.0
Name: libtirpc
# src/crypt_client.c tirpc/spinlock.h and tirpc/rpcsvc/crypt.x have the BSD
# advertising clause
Version: 0.2.5
Version: 0.3.0
Release: 0
Summary: Transport Independent RPC Library
License: BSD-4-Clause
@ -31,6 +31,7 @@ BuildRequires: krb5-mini-devel
%else
BuildRequires: krb5-devel
%endif
BuildRequires: autoconf
BuildRequires: libtool
BuildRequires: pkg-config
Url: http://sourceforge.net/projects/libtirpc/
@ -38,16 +39,12 @@ Url: http://sourceforge.net/projects/libtirpc/
Source: %{name}-%{tarversion}.tar.bz2
Source1: baselibs.conf
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
Patch1: 001-tirpc-features.patch
Patch4: 004-netconfig-prefer-IPv6.patch
Patch5: 005-no_IPv6_for_old_code.patch
Patch25: patch6_7.diff
# 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
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define debug_package_requires libtirpc1 = %{version}-%{release}
@ -73,6 +70,7 @@ TCP over IPv4
Summary: Transport Independent RPC Library
Group: Development/Libraries/C and C++
Requires: glibc-devel
Requires: krb5-devel
Requires: libtirpc1 = %{version}
%description devel
@ -84,27 +82,29 @@ TCP over IPv4
%prep
%setup -q -n %name-%tarversion
%patch0 -p0
#%patch1 -p0
%patch2 -p1
%patch3 -p1
%patch1 -p1
%patch4 -p1
%patch35 -p1
%patch36 -p1
%patch5 -p1
%patch25 -p1
%if 0%{suse_version} >= 1310
%patch37 -p1
%endif
%patch38 -p1
%patch39 -p1
%build
autoreconf -fiv
%configure --disable-static \
--with-pic \
--libdir=/%{_lib} \
--enable-gss
%if 0%{suse_version} < 1200
--disable-gssapi \
%endif
--libdir=/%{_lib}
%{__make} %{?_smp_mflags}
%install
# Don't strip .symtab to allow debugging
export STRIP_KEEP_SYMTAB=libtirpc*.so*
# NO_BRP_CHECK_ROOTFS is for SLES11 only, but does not harm for Factory
export NO_BRP_CHECK_ROOTFS=true
make install DESTDIR=$RPM_BUILD_ROOT
# move devel so link to %{_libdir}
mkdir -p $RPM_BUILD_ROOT%{_libdir}

79
patch6_7.diff Normal file
View File

@ -0,0 +1,79 @@
Most folks seem to copy this gentoo patch to silence an alleged
_FORTIFY_SOURCE=2 warning:
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-libs/libtirpc/files/libtirpc-0.2.1-fortify.patch?diff_format=s&revision=1.2&view=markup
Given that gethostbyname is obsolescent, let's just use getaddrinfo
instead (to silence warnings about the OB function).
I am undecided if setting AI_V4MAPPED and AI_ADDRCONFIG is a good idea.
Personally i would be inclined to s/if 0/if 1/ but i'll leave that up to
you.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
src/getrpcport.c | 37 +++++++++++++++++++++++++------------
1 file changed, 25 insertions(+), 12 deletions(-)
diff --git a/src/getrpcport.c b/src/getrpcport.c
index b452c99..f36158d 100644
--- a/src/getrpcport.c
+++ b/src/getrpcport.c
@@ -48,19 +48,32 @@ getrpcport(host, prognum, versnum, proto)
int prognum, versnum, proto;
{
struct sockaddr_in addr;
- struct hostent *hp;
+ struct addrinfo hints, *result, *rp;
+ int ret = 0;
assert(host != NULL);
-
- if ((hp = gethostbyname(host)) == NULL)
+ memset(&hints, 0, sizeof(struct addrinfo));
+ hints.ai_family = AF_INET; /* ??? :-( */
+#if 0
+#ifdef AI_V4MAPPED
+ hints.ai_flags |= AI_V4MAPPED;
+#endif
+#ifdef AI_ADDRCONFIG
+ hints.ai_flags |= AI_ADDRCONFIG;
+#endif
+#endif
+ if (getaddrinfo(host, NULL, &hints, &result) != 0)
return (0);
- memset(&addr, 0, sizeof(addr));
- addr.sin_family = AF_INET;
- addr.sin_port = 0;
- if (hp->h_length > sizeof(addr))
- hp->h_length = sizeof(addr);
- memcpy(&addr.sin_addr.s_addr, hp->h_addr, (size_t)hp->h_length);
- /* Inconsistent interfaces need casts! :-( */
- return (pmap_getport(&addr, (u_long)prognum, (u_long)versnum,
- (u_int)proto));
+ for (rp = result; rp != NULL; rp = rp->ai_next) {
+ assert (rp->ai_family == AF_INET && rp->ai_addrlen == 16);
+ memcpy(&addr, rp->ai_addr, rp->ai_addrlen);
+ assert (addr.sin_family == AF_INET && addr.sin_port == 0);
+ /* Inconsistent interfaces need casts! :-( */
+ ret = (pmap_getport(&addr, (u_long)prognum, (u_long)versnum,
+ (u_int)proto));
+ if (ret)
+ break;
+ }
+ freeaddrinfo(result);
+ return (ret);
}
--
2.1.4
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Libtirpc-devel mailing list
Libtirpc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libtirpc-devel