SHA256
1
0
forked from pool/libtirpc

Accepting request 314438 from Base:System

1

OBS-URL: https://build.opensuse.org/request/show/314438
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libtirpc?expand=0&rev=39
This commit is contained in:
Stephan Kulow 2015-07-05 15:53:47 +00:00 committed by Git OBS Bridge
commit eae2992915
11 changed files with 234 additions and 192 deletions

View File

@ -1,154 +0,0 @@
diff --git a/.gitignore b/.gitignore
index b7814a3..fad274f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,6 +34,8 @@ libtirpc.pc
lib*.a
src/libtirpc.la
src/libtirpc_la-*.lo
+tirpc/stamp-h2
+tirpc/tirpc-features.h
# generic editor backup et al
*~
.stgitmail.txt
diff --git a/Makefile.am b/Makefile.am
index 466b6dd..665d328 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 e3cb8af..7802304 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,7 +31,7 @@ AC_ARG_ENABLE(authdes,
[],[enable_authdes=no])
AM_CONDITIONAL(AUTHDES, test "x$enable_authdes" = xyes)
if test "x$enable_authdes" = xyes; then
- AC_DEFINE([HAVE_AUTHDES], [1],
+ AC_DEFINE([TIRPC_AUTHDES], [1],
[Define to 1 if DES authentication is enabled])
CFLAG_AUTHDES="-DHAVE_AUTHDES=1"
AC_SUBST([CFLAG_AUTHDES])
@@ -50,7 +50,7 @@ AC_ARG_ENABLE(symvers,
[],[enable_symvers=yes])
AM_CONDITIONAL(SYMVERS, test "x$enable_symvers" = xyes)
-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/auth.h b/tirpc/rpc/auth.h
index f7fa16c..3e2d1cf 100644
--- a/tirpc/rpc/auth.h
+++ b/tirpc/rpc/auth.h
@@ -51,6 +51,7 @@
#include <sys/socket.h>
#include <sys/types.h>
+#include <tirpc-features.h>
#define MAX_AUTH_BYTES 400
#define MAXNETNAMELEN 255 /* maximum length of network user's name */
@@ -164,7 +165,7 @@ union des_block {
};
typedef union des_block des_block;
-#ifdef HAVE_AUTHDES
+#ifdef TIRPC_AUTHDES
#ifdef __cplusplus
extern "C" {
#endif
@@ -172,7 +173,7 @@ extern bool_t xdr_des_block(XDR *, des_block *);
#ifdef __cplusplus
}
#endif
-#endif /* HAVE_AUTHDES */
+#endif /* TIRPC_AUTHDES */
/*
* Authentication info. Opaque to client.
@@ -320,7 +321,7 @@ extern AUTH *authnone_create(void); /* takes no parameters */
}
#endif
-#ifdef HAVE_AUTHDES
+#ifdef TIRPC_AUTHDES
/*
* DES style authentication
* AUTH *authsecdes_create(servername, window, timehost, ckey)
@@ -338,7 +339,7 @@ extern AUTH *authdes_seccreate (const char *, const u_int, const char *,
#ifdef __cplusplus
}
#endif
-#endif /* HAVE_AUTHDES */
+#endif /* TIRPC_AUTHDES */
#ifdef __cplusplus
extern "C" {
@@ -362,9 +363,9 @@ extern int host2netname(char *, const char *, const char *);
extern int user2netname(char *, const uid_t, const char *);
extern int netname2user(char *, uid_t *, gid_t *, int *, gid_t *);
extern int netname2host(char *, char *, const int);
-#ifdef HAVE_AUTHDES
+#ifdef TIRPC_AUTHDES
extern void passwd2des ( char *, char * );
-#endif /* HAVE_AUTHDES */
+#endif /* TIRPC_AUTHDES */
#ifdef __cplusplus
}
#endif
diff --git a/tirpc/rpc/rpc.h b/tirpc/rpc/rpc.h
index 392a7b9..7517264 100644
--- a/tirpc/rpc/rpc.h
+++ b/tirpc/rpc/rpc.h
@@ -39,6 +39,8 @@
#include <sys/socket.h>
#include <netinet/in.h>
+#include <tirpc-features.h>
+
/* external data representation interfaces */
#include <rpc/xdr.h> /* generic (de)serializer */
@@ -52,13 +54,13 @@
#include <rpc/rpc_msg.h> /* protocol for rpc messages */
#include <rpc/auth_unix.h> /* protocol for unix style cred */
-#ifdef HAVE_AUTHDES
+#ifdef TIRPC_AUTHDES
/*
* Uncomment-out the next line if you are building the rpc library with
* DES Authentication (see the README file in the secure_rpc/ directory).
*/
#include <rpc/auth_des.h> /* protocol for des style cred */
-#endif /* HAVE_AUTHDES */
+#endif /* TIRPC_AUTHDES */
/* Server side only remote procedure callee */
#include <rpc/svc_auth.h> /* service side authenticator */
diff --git a/tirpc/tirpc-features.h.in b/tirpc/tirpc-features.h.in
new file mode 100644
index 0000000..9bea966
--- /dev/null
+++ b/tirpc/tirpc-features.h.in
@@ -0,0 +1,7 @@
+#ifndef _TIRPC_FEATURES_H
+#define _TIRPC_FEATURES_H
+
+/* Define to 1 if DES authentication is enabled */
+#undef TIRPC_AUTHDES
+
+#endif /* _TIRPC_FEATURES_H */

View File

@ -3,7 +3,7 @@ index 290c635..a6a202e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,4 @@
AC_INIT(libtirpc, 0.3.1)
AC_INIT(libtirpc, 0.3.2)
-AM_INIT_AUTOMAKE([silent-rules])
+AM_INIT_AUTOMAKE
-AM_SILENT_RULES([yes])

18
005-missing-symvers.patch Normal file
View File

@ -0,0 +1,18 @@
diff --git a/src/libtirpc.map b/src/libtirpc.map
index 063cddd..449b769 100644
--- a/src/libtirpc.map
+++ b/src/libtirpc.map
@@ -316,6 +316,13 @@ TIRPC_0.3.2 {
xdr_unixcred;
} TIRPC_0.3.1;
+TIRPC_0.3.3 {
+ __getpublickey_LOCAL;
+ __key_decryptsession_pk_LOCAL;
+ __key_encryptsession_pk_LOCAL;
+ __key_gendes_LOCAL;
+} TIRPC_0.3.2;
+
TIRPC_PRIVATE {
global:
__libc_clntudp_bufcreate;

View File

@ -1,24 +0,0 @@
diff --git a/src/rpc_generic.c b/src/rpc_generic.c
index 6148830..f443c47 100644
--- a/src/rpc_generic.c
+++ b/src/rpc_generic.c
@@ -213,7 +213,8 @@ getnettype(nettype)
}
/*
- * For the given nettype (tcp or udp only), return the first structure found.
+ * For the given nettype (tcp or udp only), return the first
+ * IPv4 structure found.
* This should be freed by calling freenetconfigent()
*/
struct netconfig *
@@ -250,8 +251,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);

41
006-memleak1.patch Normal file
View File

@ -0,0 +1,41 @@
xprt->xp_netid can be allocated by makefd_xprt() in
svc_fd_create(), so don't blindly overwrite the
pointer in svc_tli_create()
The API expection is the nc_netid passed in will be
used for the xp_netid. So the pointer must be
freed then re-allocated.
Reported-by: Michael Theall <mtheall@us.ibm.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
---
src/svc_generic.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/svc_generic.c b/src/svc_generic.c
index f49d776..7aae796 100644
--- a/src/svc_generic.c
+++ b/src/svc_generic.c
@@ -283,6 +283,8 @@ svc_tli_create(fd, nconf, bindaddr, sendsz, recvsz)
xprt->xp_type = __rpc_socktype2seman(si.si_socktype);
if (nconf) {
+ if (xprt->xp_netid != NULL)
+ free(xprt->xp_netid);
xprt->xp_netid = strdup(nconf->nc_netid);
xprt->xp_tp = strdup(nconf->nc_device);
}
--
2.4.3
------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Libtirpc-devel mailing list
Libtirpc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libtirpc-devel

56
007-memleak2.patch Normal file
View File

@ -0,0 +1,56 @@
A rendezvouser socket is defined by a
xp_port value of (u_short)-1 which does
not work because xp_port is overwritten
by svc_com_create() and 65535 is a valid
port value.
To ensure actual connections get freed
properly in __svc_vc_dodestroy(), compare
the xp_recv value to rendezvous_request.
Reported-by: Michael Theall <mtheall@us.ibm.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
---
src/svc_vc.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/svc_vc.c b/src/svc_vc.c
index 9824631..6848c09 100644
--- a/src/svc_vc.c
+++ b/src/svc_vc.c
@@ -392,6 +392,12 @@ svc_vc_destroy(xprt)
__svc_vc_dodestroy(xprt);
}
+static bool_t
+__svc_rendezvous_socket(xprt)
+ SVCXPRT *xprt;
+{
+ return (xprt->xp_ops->xp_recv == rendezvous_request);
+}
static void
__svc_vc_dodestroy(xprt)
SVCXPRT *xprt;
@@ -403,7 +409,7 @@ __svc_vc_dodestroy(xprt)
if (xprt->xp_fd != RPC_ANYFD)
(void)close(xprt->xp_fd);
- if (xprt->xp_port != 0) {
+ if (__svc_rendezvous_socket(xprt)) {
/* a rendezvouser socket */
r = (struct cf_rendezvous *)xprt->xp_p1;
mem_free(r, sizeof (struct cf_rendezvous));
--
2.4.3
------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Libtirpc-devel mailing list
Libtirpc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libtirpc-devel

88
008-fix-undef-ref.patch Normal file
View File

@ -0,0 +1,88 @@
diff -Naur a/src/Makefile.am b/src/Makefile.am
--- a/src/Makefile.am 2015-06-16 17:35:08.000000000 +0200
+++ b/src/Makefile.am 2015-06-17 21:23:05.185276962 +0200
@@ -69,7 +69,7 @@
endif
libtirpc_la_SOURCES += key_call.c key_prot_xdr.c getpublickey.c
-libtirpc_la_SOURCES += netname.c netnamer.c rtime.c
+libtirpc_la_SOURCES += netname.c netnamer.c rpcdname.c rtime.c
CLEANFILES = cscope.* *~
DISTCLEANFILES = Makefile.in
diff -Naur a/src/rpcdname.c b/src/rpcdname.c
--- a/src/rpcdname.c 1970-01-01 01:00:00.000000000 +0100
+++ b/src/rpcdname.c 2015-06-17 21:23:05.186276982 +0200
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2009, Sun Microsystems, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * - Neither the name of Sun Microsystems, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * rpcdname.c
+ * Gets the default domain name
+ */
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+
+static char *default_domain = 0;
+
+static char *
+get_default_domain()
+{
+ char temp[256];
+
+ if (default_domain)
+ return (default_domain);
+ if (getdomainname(temp, sizeof(temp)) < 0)
+ return (0);
+ if ((int) strlen(temp) > 0) {
+ default_domain = (char *)malloc((strlen(temp)+(unsigned)1));
+ if (default_domain == 0)
+ return (0);
+ (void) strcpy(default_domain, temp);
+ return (default_domain);
+ }
+ return (0);
+}
+
+/*
+ * This is a wrapper for the system call getdomainname which returns a
+ * ypclnt.h error code in the failure case. It also checks to see that
+ * the domain name is non-null, knowing that the null string is going to
+ * get rejected elsewhere in the NIS client package.
+ */
+int
+__rpc_get_default_domain(domain)
+ char **domain;
+{
+ if ((*domain = get_default_domain()) != 0)
+ return (0);
+ return (-1);
+}

View File

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

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

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

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Wed Jun 24 16:44:06 CEST 2015 - kukuk@suse.de
- Add 008-fix-undef-ref.patch to fix a undefined reference bug
-------------------------------------------------------------------
Tue Jun 23 14:15:25 CEST 2015 - kukuk@suse.de
- Update to version 0.3.2 (bring authdes back)
- Remove 005-no_IPv6_for_old_code.patch (accepted upstream)
- Remove 001-tirpc-features.patch (obsolete)
- Add 005-missing-symvers.patch (fix missing, new symbols)
- Add 006-memleak1.patch (fix memory leak)
- Add 007-memleak2.patch (fix memory leak)
-------------------------------------------------------------------
Mon Jun 1 17:06:29 CEST 2015 - kukuk@suse.de

View File

@ -16,12 +16,10 @@
#
%define tarversion 0.3.1
Name: libtirpc
# src/crypt_client.c tirpc/spinlock.h and tirpc/rpcsvc/crypt.x have the BSD
# advertising clause
Version: 0.3.1
Version: 0.3.2
Release: 0
Summary: Transport Independent RPC Library
License: BSD-4-Clause
@ -35,15 +33,17 @@ BuildRequires: autoconf
BuildRequires: libtool
BuildRequires: pkg-config
Url: http://sourceforge.net/projects/libtirpc/
# http://downloads.sourceforge.net/project/%{name}/%{name}/%{version}/%{name}-%{tarversion}.tar.bz2
Source: %{name}-%{tarversion}.tar.bz2
# http://downloads.sourceforge.net/project/%{name}/%{name}/%{version}/%{name}-%{version}.tar.bz2
Source: %{name}-%{version}.tar.bz2
Source1: baselibs.conf
Patch0: 000-bindresvport_blacklist.patch
Patch1: 001-tirpc-features.patch
# Patch2 is only needed for SLES11
Patch2: 002-old-automake.patch
Patch4: 004-netconfig-prefer-IPv6.patch
Patch5: 005-no_IPv6_for_old_code.patch
Patch5: 005-missing-symvers.patch
Patch6: 006-memleak1.patch
Patch7: 007-memleak2.patch
Patch8: 008-fix-undef-ref.patch
Patch25: patch6_7.diff
# Patch37 is only needed on openSUSE >= 13.1, SLE >= 12
Patch37: libtirpc-new-path-rpcbindsock.patch
@ -81,13 +81,15 @@ This implementation allows the support of other transports than UDP and
TCP over IPv4
%prep
%setup -q -n %name-%tarversion
%setup -q -n %name-%version
%patch0 -p0
%patch1 -p1
%patch2 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch25 -p1
%patch2 -p1
%if 0%{suse_version} >= 1310
%patch37 -p1
%endif