Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 17440220bdcd27ea304c78fdd0363adb76770c14 Mon Sep 17 00:00:00 2001
- From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
- Date: Sun, 24 Jun 2012 10:25:05 +0200
- Subject: [PATCH] libtirpc: allow glibc[>=2.14]
- Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
- ---
- .../files/libtirpc-0.2.2-glibc-2.14-compat.patch | 157 ++++++++++++++++++++
- .../net-libs/libtirpc/libtirpc-0.2.2-r2.exheres-0 | 8 +-
- 2 files changed, 163 insertions(+), 2 deletions(-)
- create mode 100644 packages/net-libs/libtirpc/files/libtirpc-0.2.2-glibc-2.14-compat.patch
- diff --git a/packages/net-libs/libtirpc/files/libtirpc-0.2.2-glibc-2.14-compat.patch b/packages/net-libs/libtirpc/files/libtirpc-0.2.2-glibc-2.14-compat.patch
- new file mode 100644
- index 0000000..43216cc
- --- /dev/null
- +++ b/packages/net-libs/libtirpc/files/libtirpc-0.2.2-glibc-2.14-compat.patch
- @@ -0,0 +1,157 @@
- +From aa844bc39751c64b6ea13c376e77d74b7b0793c3 Mon Sep 17 00:00:00 2001
- +From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
- +Date: Sun, 24 Jun 2012 00:35:44 +0200
- +Subject: [PATCH] glibc >=2.14 compatibility
- +
- +Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
- +---
- + src/clnt_vc.c | 2 ++
- + src/getpeereid.c | 11 +++++++++++
- + src/rpc_soc.c | 5 +++++
- + src/svc_auth_gss.c | 1 +
- + src/svc_dg.c | 6 ++++++
- + tirpc/reentrant.h | 2 +-
- + 6 files changed, 26 insertions(+), 1 deletion(-)
- +
- +diff --git a/src/clnt_vc.c b/src/clnt_vc.c
- +index 097cae8..300ac0e 100644
- +--- a/src/clnt_vc.c
- ++++ b/src/clnt_vc.c
- +@@ -70,6 +70,7 @@
- + #define MCALL_MSG_SIZE 24
- +
- + #define CMGROUP_MAX 16
- ++#ifndef SCM_CREDS
- + #define SCM_CREDS 0x03 /* process creds (struct cmsgcred) */
- +
- + /*
- +@@ -87,6 +88,7 @@ struct cmsgcred {
- + short cmcred_ngroups; /* number or groups */
- + gid_t cmcred_groups[CMGROUP_MAX]; /* groups */
- + };
- ++#endif
- +
- + struct cmessage {
- + struct cmsghdr cmsg;
- +diff --git a/src/getpeereid.c b/src/getpeereid.c
- +index 57ee197..081144e 100644
- +--- a/src/getpeereid.c
- ++++ b/src/getpeereid.c
- +@@ -29,6 +29,7 @@
- + #include <sys/param.h>
- + #include <sys/socket.h>
- + #include <sys/un.h>
- ++#include <sys/user.h>
- +
- + #include <errno.h>
- + #include <unistd.h>
- +@@ -36,12 +37,22 @@
- + int
- + getpeereid(int s, uid_t *euid, gid_t *egid)
- + {
- ++#ifdef XUCRED_VERSION
- ++ struct xucred uc;
- ++#define uid cr_uid
- ++#define gid cr_gid
- ++#else
- + struct ucred uc;
- ++#endif
- + socklen_t uclen;
- + int error;
- +
- + uclen = sizeof(uc);
- ++#ifdef XUCRED_VERSION
- ++ error = getsockopt(s, 0, LOCAL_PEERCRED, &uc, &uclen);
- ++#else
- + error = getsockopt(s, SOL_SOCKET, SO_PEERCRED, &uc, &uclen); /* SCM_CREDENTIALS */
- ++#endif
- + if (error != 0)
- + return (error);
- + // if (uc.cr_version != XUCRED_VERSION)
- +diff --git a/src/rpc_soc.c b/src/rpc_soc.c
- +index 63d2197..c11147f 100644
- +--- a/src/rpc_soc.c
- ++++ b/src/rpc_soc.c
- +@@ -105,6 +105,7 @@ clnt_com_create(raddr, prog, vers, sockp, sendsz, recvsz, tp, flags)
- + static int have_cloexec;
- + fd = __rpc_nconf2fd_flags(nconf, flags);
- + if (fd == -1) {
- ++#ifdef SOCK_CLOEXEC
- + if ((flags & SOCK_CLOEXEC) && have_cloexec <= 0) {
- + fd = __rpc_nconf2fd(nconf);
- + if (fd == -1)
- +@@ -117,6 +118,10 @@ clnt_com_create(raddr, prog, vers, sockp, sendsz, recvsz, tp, flags)
- + goto syserror;
- + } else if (flags & SOCK_CLOEXEC)
- + have_cloexec = 1;
- ++#else
- ++ goto syserror;
- ++ }
- ++#endif
- + madefd = TRUE;
- + }
- +
- +diff --git a/src/svc_auth_gss.c b/src/svc_auth_gss.c
- +index 9c74313..1f47760 100644
- +--- a/src/svc_auth_gss.c
- ++++ b/src/svc_auth_gss.c
- +@@ -386,6 +386,7 @@ _svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, bool_t *no_dispatch)
- + return (AUTH_FAILED);
- + }
- + if ((gd = calloc(sizeof(*gd), 1)) == NULL) {
- ++ free(auth);
- + fprintf(stderr, "svcauth_gss: out_of_memory\n");
- + return (AUTH_FAILED);
- + }
- +diff --git a/src/svc_dg.c b/src/svc_dg.c
- +index 081db61..3c443fd 100644
- +--- a/src/svc_dg.c
- ++++ b/src/svc_dg.c
- +@@ -647,6 +647,7 @@ cache_get(xprt, msg, replyp, replylenp)
- + void
- + svc_dg_enable_pktinfo(int fd, const struct __rpc_sockinfo *si)
- + {
- ++#ifdef __linux__
- + int val = 1;
- +
- + switch (si->si_af) {
- +@@ -658,6 +659,7 @@ svc_dg_enable_pktinfo(int fd, const struct __rpc_sockinfo *si)
- + (void) setsockopt(fd, SOL_IPV6, IPV6_PKTINFO, &val, sizeof(val));
- + break;
- + }
- ++#endif
- + }
- +
- + /*
- +@@ -668,6 +670,7 @@ svc_dg_enable_pktinfo(int fd, const struct __rpc_sockinfo *si)
- + int
- + svc_dg_valid_pktinfo(struct msghdr *msg)
- + {
- ++#ifdef __linux__
- + struct cmsghdr *cmsg;
- +
- + if (!msg->msg_name)
- +@@ -712,4 +715,7 @@ svc_dg_valid_pktinfo(struct msghdr *msg)
- + }
- +
- + return 1;
- ++#else
- ++ return 0;
- ++#endif
- + }
- +diff --git a/tirpc/reentrant.h b/tirpc/reentrant.h
- +index 9489b15..144817f 100644
- +--- a/tirpc/reentrant.h
- ++++ b/tirpc/reentrant.h
- +@@ -36,7 +36,7 @@
- + * These definitions are only guaranteed to be valid on Linux.
- + */
- +
- +-#if defined(__linux__)
- ++#if defined(__linux__) || defined(__GLIBC__)
- +
- + #include <pthread.h>
- +
- +--
- +1.7.10.4
- +
- diff --git a/packages/net-libs/libtirpc/libtirpc-0.2.2-r2.exheres-0 b/packages/net-libs/libtirpc/libtirpc-0.2.2-r2.exheres-0
- index 8da4ffc..c7230ee 100644
- --- a/packages/net-libs/libtirpc/libtirpc-0.2.2-r2.exheres-0
- +++ b/packages/net-libs/libtirpc/libtirpc-0.2.2-r2.exheres-0
- @@ -17,8 +17,6 @@ multibuild_c: 32 64
- "
- DEPENDENCIES="
- - build:
- - !sys-libs/glibc[>=2.14] [[ description = [ Missing header files ] ]]
- build+run:
- gss? ( net-libs/libgssglue )
- "
- @@ -28,6 +26,12 @@ DEFAULT_SRC_PREPARE_PATCHES=(
- "${FILES}/${PNV}-doc-Makefile-am.patch"
- )
- +if ever has_version sys-libs/glibc[>=2.14]; then
- + DEFAULT_SRC_PREPARE_PATCHES+=(
- + "${FILES}"/${PNV}-glibc-2.14-compat.patch
- + )
- +fi
- +
- DEFAULT_SRC_CONFIGURE_OPTION_ENABLES=( gss )
- --
- 1.7.10.4
Add Comment
Please, Sign In to add comment