Guest User

Untitled

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