Guest User

Untitled

a guest
Nov 17th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.02 KB | None | 0 0
  1. From a29c5f5f752d03b882f47568feefa8fb3d2a17a0 Mon Sep 17 00:00:00 2001
  2. From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
  3. Date: Sun, 24 Jun 2012 10:25:05 +0200
  4. Subject: [PATCH] libtirpc: allow glibc[>=2.14]
  5.  
  6. Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
  7. ---
  8. .../files/libtirpc-0.2.2-glibc-2.14-compat.patch | 157 ++++++++++++++++++++
  9. ....2-r2.exheres-0 => libtirpc-0.2.3rc3.exheres-0} | 9 +-
  10. 2 files changed, 162 insertions(+), 4 deletions(-)
  11. create mode 100644 packages/net-libs/libtirpc/files/libtirpc-0.2.2-glibc-2.14-compat.patch
  12. rename packages/net-libs/libtirpc/{libtirpc-0.2.2-r2.exheres-0 => libtirpc-0.2.3rc3.exheres-0} (88%)
  13.  
  14. 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
  15. new file mode 100644
  16. index 0000000..43216cc
  17. --- /dev/null
  18. +++ b/packages/net-libs/libtirpc/files/libtirpc-0.2.2-glibc-2.14-compat.patch
  19. @@ -0,0 +1,157 @@
  20. +From aa844bc39751c64b6ea13c376e77d74b7b0793c3 Mon Sep 17 00:00:00 2001
  21. +From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
  22. +Date: Sun, 24 Jun 2012 00:35:44 +0200
  23. +Subject: [PATCH] glibc >=2.14 compatibility
  24. +
  25. +Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
  26. +---
  27. + src/clnt_vc.c | 2 ++
  28. + src/getpeereid.c | 11 +++++++++++
  29. + src/rpc_soc.c | 5 +++++
  30. + src/svc_auth_gss.c | 1 +
  31. + src/svc_dg.c | 6 ++++++
  32. + tirpc/reentrant.h | 2 +-
  33. + 6 files changed, 26 insertions(+), 1 deletion(-)
  34. +
  35. +diff --git a/src/clnt_vc.c b/src/clnt_vc.c
  36. +index 097cae8..300ac0e 100644
  37. +--- a/src/clnt_vc.c
  38. ++++ b/src/clnt_vc.c
  39. +@@ -70,6 +70,7 @@
  40. + #define MCALL_MSG_SIZE 24
  41. +
  42. + #define CMGROUP_MAX 16
  43. ++#ifndef SCM_CREDS
  44. + #define SCM_CREDS 0x03 /* process creds (struct cmsgcred) */
  45. +
  46. + /*
  47. +@@ -87,6 +88,7 @@ struct cmsgcred {
  48. + short cmcred_ngroups; /* number or groups */
  49. + gid_t cmcred_groups[CMGROUP_MAX]; /* groups */
  50. + };
  51. ++#endif
  52. +
  53. + struct cmessage {
  54. + struct cmsghdr cmsg;
  55. +diff --git a/src/getpeereid.c b/src/getpeereid.c
  56. +index 57ee197..081144e 100644
  57. +--- a/src/getpeereid.c
  58. ++++ b/src/getpeereid.c
  59. +@@ -29,6 +29,7 @@
  60. + #include <sys/param.h>
  61. + #include <sys/socket.h>
  62. + #include <sys/un.h>
  63. ++#include <sys/user.h>
  64. +
  65. + #include <errno.h>
  66. + #include <unistd.h>
  67. +@@ -36,12 +37,22 @@
  68. + int
  69. + getpeereid(int s, uid_t *euid, gid_t *egid)
  70. + {
  71. ++#ifdef XUCRED_VERSION
  72. ++ struct xucred uc;
  73. ++#define uid cr_uid
  74. ++#define gid cr_gid
  75. ++#else
  76. + struct ucred uc;
  77. ++#endif
  78. + socklen_t uclen;
  79. + int error;
  80. +
  81. + uclen = sizeof(uc);
  82. ++#ifdef XUCRED_VERSION
  83. ++ error = getsockopt(s, 0, LOCAL_PEERCRED, &uc, &uclen);
  84. ++#else
  85. + error = getsockopt(s, SOL_SOCKET, SO_PEERCRED, &uc, &uclen); /* SCM_CREDENTIALS */
  86. ++#endif
  87. + if (error != 0)
  88. + return (error);
  89. + // if (uc.cr_version != XUCRED_VERSION)
  90. +diff --git a/src/rpc_soc.c b/src/rpc_soc.c
  91. +index 63d2197..c11147f 100644
  92. +--- a/src/rpc_soc.c
  93. ++++ b/src/rpc_soc.c
  94. +@@ -105,6 +105,7 @@ clnt_com_create(raddr, prog, vers, sockp, sendsz, recvsz, tp, flags)
  95. + static int have_cloexec;
  96. + fd = __rpc_nconf2fd_flags(nconf, flags);
  97. + if (fd == -1) {
  98. ++#ifdef SOCK_CLOEXEC
  99. + if ((flags & SOCK_CLOEXEC) && have_cloexec <= 0) {
  100. + fd = __rpc_nconf2fd(nconf);
  101. + if (fd == -1)
  102. +@@ -117,6 +118,10 @@ clnt_com_create(raddr, prog, vers, sockp, sendsz, recvsz, tp, flags)
  103. + goto syserror;
  104. + } else if (flags & SOCK_CLOEXEC)
  105. + have_cloexec = 1;
  106. ++#else
  107. ++ goto syserror;
  108. ++ }
  109. ++#endif
  110. + madefd = TRUE;
  111. + }
  112. +
  113. +diff --git a/src/svc_auth_gss.c b/src/svc_auth_gss.c
  114. +index 9c74313..1f47760 100644
  115. +--- a/src/svc_auth_gss.c
  116. ++++ b/src/svc_auth_gss.c
  117. +@@ -386,6 +386,7 @@ _svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, bool_t *no_dispatch)
  118. + return (AUTH_FAILED);
  119. + }
  120. + if ((gd = calloc(sizeof(*gd), 1)) == NULL) {
  121. ++ free(auth);
  122. + fprintf(stderr, "svcauth_gss: out_of_memory\n");
  123. + return (AUTH_FAILED);
  124. + }
  125. +diff --git a/src/svc_dg.c b/src/svc_dg.c
  126. +index 081db61..3c443fd 100644
  127. +--- a/src/svc_dg.c
  128. ++++ b/src/svc_dg.c
  129. +@@ -647,6 +647,7 @@ cache_get(xprt, msg, replyp, replylenp)
  130. + void
  131. + svc_dg_enable_pktinfo(int fd, const struct __rpc_sockinfo *si)
  132. + {
  133. ++#ifdef __linux__
  134. + int val = 1;
  135. +
  136. + switch (si->si_af) {
  137. +@@ -658,6 +659,7 @@ svc_dg_enable_pktinfo(int fd, const struct __rpc_sockinfo *si)
  138. + (void) setsockopt(fd, SOL_IPV6, IPV6_PKTINFO, &val, sizeof(val));
  139. + break;
  140. + }
  141. ++#endif
  142. + }
  143. +
  144. + /*
  145. +@@ -668,6 +670,7 @@ svc_dg_enable_pktinfo(int fd, const struct __rpc_sockinfo *si)
  146. + int
  147. + svc_dg_valid_pktinfo(struct msghdr *msg)
  148. + {
  149. ++#ifdef __linux__
  150. + struct cmsghdr *cmsg;
  151. +
  152. + if (!msg->msg_name)
  153. +@@ -712,4 +715,7 @@ svc_dg_valid_pktinfo(struct msghdr *msg)
  154. + }
  155. +
  156. + return 1;
  157. ++#else
  158. ++ return 0;
  159. ++#endif
  160. + }
  161. +diff --git a/tirpc/reentrant.h b/tirpc/reentrant.h
  162. +index 9489b15..144817f 100644
  163. +--- a/tirpc/reentrant.h
  164. ++++ b/tirpc/reentrant.h
  165. +@@ -36,7 +36,7 @@
  166. + * These definitions are only guaranteed to be valid on Linux.
  167. + */
  168. +
  169. +-#if defined(__linux__)
  170. ++#if defined(__linux__) || defined(__GLIBC__)
  171. +
  172. + #include <pthread.h>
  173. +
  174. +--
  175. +1.7.10.4
  176. +
  177. diff --git a/packages/net-libs/libtirpc/libtirpc-0.2.2-r2.exheres-0 b/packages/net-libs/libtirpc/libtirpc-0.2.3rc3.exheres-0
  178. similarity index 88%
  179. rename from packages/net-libs/libtirpc/libtirpc-0.2.2-r2.exheres-0
  180. rename to packages/net-libs/libtirpc/libtirpc-0.2.3rc3.exheres-0
  181. index 8da4ffc..cd335a5 100644
  182. --- a/packages/net-libs/libtirpc/libtirpc-0.2.2-r2.exheres-0
  183. +++ b/packages/net-libs/libtirpc/libtirpc-0.2.3rc3.exheres-0
  184. @@ -17,8 +17,6 @@ multibuild_c: 32 64
  185. "
  186.  
  187. DEPENDENCIES="
  188. - build:
  189. - !sys-libs/glibc[>=2.14] [[ description = [ Missing header files ] ]]
  190. build+run:
  191. gss? ( net-libs/libgssglue )
  192. "
  193. @@ -30,10 +28,13 @@ DEFAULT_SRC_PREPARE_PATCHES=(
  194.  
  195. DEFAULT_SRC_CONFIGURE_OPTION_ENABLES=( gss )
  196.  
  197. -
  198. -prepare_one_multibuild() {
  199. +src_prepare() {
  200. default
  201.  
  202. + if has_version "sys-libs/glibc[>=2.14]"; then
  203. + expatch "${FILES}"/${PNV}-glibc-2.14-compat.patch
  204. + fi
  205. +
  206. eautoreconf
  207. }
  208.  
  209. --
  210. 1.7.10.4
Add Comment
Please, Sign In to add comment