Gentoo Archives: gentoo-commits

From: Aric Belsito <lluixhi@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: net-libs/libtirpc/files/, net-libs/libtirpc/
Date: Thu, 06 Jul 2017 18:07:52
Message-Id: 1499364424.2ff3ccca9589b6d1f418ec45db7295549df0b3cd.lluixhi@gentoo
1 commit: 2ff3ccca9589b6d1f418ec45db7295549df0b3cd
2 Author: Aric Belsito <lluixhi <AT> gmail <DOT> com>
3 AuthorDate: Thu Jul 6 18:07:04 2017 +0000
4 Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com>
5 CommitDate: Thu Jul 6 18:07:04 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=2ff3ccca
7
8 net-libs/libtirpc: version bump to 1.0.1-r2
9
10 patch needed to be refreshed because it conflicts with other patches.
11
12 net-libs/libtirpc/Manifest | 10 +-
13 ...ibtirpc-1.0.1_add-des_impl-c-7f6bb9a3467a.patch | 29 +
14 ...c-1.0.1_ifdef-out-yp-headers-742bbdff6ddf.patch | 30 +
15 ...0.1_remove-des-deps-to-glibc-503ac2e9fa56.patch | 43 ++
16 ...tirpc-1.0.1_remove-nis-h-dep-5f00f8c78c5d.patch | 137 +++++
17 ...tirpc-1.0.1_uclibc-dont-use-struct-rpcent.patch | 51 ++
18 ...ibtirpc-1.0.1_uclibc-use-memset-not-bzero.patch | 21 +
19 net-libs/libtirpc/files/musl-1.0.1_r2.patch | 647 +++++++++++++++++++++
20 net-libs/libtirpc/libtirpc-1.0.1-r1.ebuild | 2 +-
21 ...pc-1.0.1-r1.ebuild => libtirpc-1.0.1-r2.ebuild} | 11 +-
22 10 files changed, 977 insertions(+), 4 deletions(-)
23
24 diff --git a/net-libs/libtirpc/Manifest b/net-libs/libtirpc/Manifest
25 index b1e5bd4..2b95501 100644
26 --- a/net-libs/libtirpc/Manifest
27 +++ b/net-libs/libtirpc/Manifest
28 @@ -7,10 +7,18 @@ AUX 0007-no-des.patch 960 SHA256 12823f030b803045108df782018d04ca253d4439b0e9201
29 AUX git.patch 24736 SHA256 0a62de190d38660efff0ddbb73b5b6315fdc015c20cf9c235e35c0cf7eeb0e85 SHA512 4dd540470e9a25b5df0ea2c883dd647f26b71ed82e880c7efa4eed51dd98b898e18964a3ee998ceeadf39caed0a661f110f72157ec70584e33131d0a0f375a00 WHIRLPOOL 3b7fe2207ea84b56ce889778c4ef31669afe7dd340270063c1ac09accc3459e4d53bd5d084bfa090ec041fb188cd8bac6aad55d7fd60f43e485c89d53e06b14e
30 AUX libtirpc-0.2.5-stdarg.patch 667 SHA256 2b31b1148af9d96c9a9e6f609c0b5b03424954d6251c18d64b6119afd8afa6f7 SHA512 2197f8c2ed3b4dbfc54ee37e973a6e275d19c6dde5d066b9ce45beecdbb17c9e620d7c6f0997b7ebfeb2bd1741327028a793b34edd94d59a89c8b36ac102b025 WHIRLPOOL 90d4e88c18f0d93ab8dfef4981377c2a6df42ff90b70049d07e203e7b66a5087910fe501cf9e1b93782eb25a8b3a8680c03287ccc563b838f517e5d1524b12c5
31 AUX libtirpc-1.0.1-CVE-2017-8779.patch 7032 SHA256 091d3ff2b53a3ef9b20c61af19192434f652e528070fd57c706bce2988de0279 SHA512 b7c97f6f202cd57c988ff026e2805011942f470c71fdfd81a2647a0e197386db937b022f0056e6ad106bb143c36323835748965b4915a293b89efba3cd171c84 WHIRLPOOL 44f65f1fadec76e742641a3ec7c22f90f54309c3b9e6f1076b2de1dd14aaf0012c323d3c92599775b43446405253cf1375d9c4c3d5bf26d8de1224b42a552ead
32 +AUX libtirpc-1.0.1_add-des_impl-c-7f6bb9a3467a.patch 1207 SHA256 1e65651a135c7c10a5ffae19ff176eb479b125b252ff4222dcd6797d583d9163 SHA512 dd6c61bc885dace248bf69d9fa15d79cb8a73530c434f834a3c53ad5d3f5598b0b04786d9d708b25c53202d2421c0888e00b9c1a260abcafa776f25cef694c19 WHIRLPOOL d436222fa75dbf26346f870aedafb1326d61c883ba90a563e99e2d56b4fc3521296cfa7bb554bbca238dea37c5dde72de802a85cfd5193da330b4c8f6a6c5fd7
33 +AUX libtirpc-1.0.1_ifdef-out-yp-headers-742bbdff6ddf.patch 821 SHA256 96ffc42c9c7acf1b95b39f76f817caf9f2fd555de3fca593390154e1327e9777 SHA512 3733c1e88acf91f30ec647f83f6ad44d1dbe087e89996db7cd4197b7eed7924443fb4854bfb4c0e5ce0e2c7b3569e2af444a1e6a8a4139ea3c408e9838419b88 WHIRLPOOL 3a9cc31c4e2eb8dfbf1e3a44caabcc90c52d0d2c30088f2120ee549060d66923f5170b6b3129598d1c70886735b7f69e65fa7142db4c07331ece3487b3298ac2
34 +AUX libtirpc-1.0.1_remove-des-deps-to-glibc-503ac2e9fa56.patch 1232 SHA256 fffab75fc00ebcbb1d860d1869d9e525ede9aca68f46e40c9d94b2ee0e563d2d SHA512 24a5012481eae9d8152267287546b390edb0fe9925bc043df50a3b82057517487e8a1b94782adc9e14ac1e72ded9b1cb44dd25e09c9a5451053a26adb3a821a2 WHIRLPOOL e210f5417d74b8589c7898f319c91e5c3c6244e703fa9fbf3fb089ec63f2694f1f6acc082a30d2f3a55131e4b0d69708ac5c2785ae5b13651217d8047adba345
35 +AUX libtirpc-1.0.1_remove-nis-h-dep-5f00f8c78c5d.patch 4015 SHA256 c185fd419d636a0992813b3f674f9a847ba28c56a6236246f36f39d29214d6d9 SHA512 fcd76037bd78e298a261f288b51de6ff25d362c40a416e86ed2c766b3c106339e4633e92546b96b727d38d14c85566250be25b82c1093c470e8c8cb1c86faafa WHIRLPOOL b1d4d4f58f6dadad87680ef1a4f7e5b67035f9e36dff24d1609430c4de31c6bb3e169cb052f982198409a0521d7e2ee910df4e395709b05fa0a511e1580666ba
36 +AUX libtirpc-1.0.1_uclibc-dont-use-struct-rpcent.patch 2010 SHA256 a747da94e2a7d5dc260ddcd5d52a3a787f4dc78076e6f2d8444a42e997a00e70 SHA512 0486bd17ab67aaeba1ed536c20297f78091c2b5badb7ce41cd0cfdb0c6139e8501b827d40798b03f114e2bf03f4c98a684aa43f47cc5a1953f8245292a0f036a WHIRLPOOL bd3f9938903e4d70ce0710c608d7da85deb2f12f9a315809b5c127428869ffbce802ae5bce99aba531fb0399d5214345379478c5f7e463dcacb5dfeb33f4d8b7
37 +AUX libtirpc-1.0.1_uclibc-use-memset-not-bzero.patch 759 SHA256 177266c0e4658af8b5b6c1c0ff7ce7fca08410a5e1acf2c395a341e6a6de84a1 SHA512 122a1ae24fc08ede5580d31749f7e1cfc21266b628e2f82936feef856b2ea5b0da99f60291e5bdf87d87c5711891515b0c6bdc351b0bd46f97192ab215e5f25d WHIRLPOOL ebd781854a5b7d7f1fcd84e595d42c8394a5b9f7c8651c9750fe4fbdf5fd884e84ca081957f433d2aecb12bd5b5e9f9f0b81bb177fa8eae180c3d63344d4ed11
38 +AUX musl-1.0.1_r2.patch 19241 SHA256 bde66b09e13f2ee032254407c12b4753d9286ba49e4afc940b8224b9facd54b2 SHA512 9f36f4189f58ccb34d9261e03857b44fcd25276514e2e8c559df06a3c63c0f5a4748c4299bbd5b9e06ef78ee6306c6fe9762a17fe7bd19474e2b02b7e6e8ec3a WHIRLPOOL dd5c0f6c1fa741104597e8baabf98f750c7a510ad2f7a5fa6494e9d1ec4c325b89496c9c5af7fd345150548e05b53b0b2584b378f9fcac8276348213d70c7491
39 DIST libtirpc-0.2.5.tar.bz2 459094 SHA256 62f9de7c2c8686c568757730e1fef66502a0e00d6cacf33546d0267984e002db SHA512 9f8afa1acb04a2c2c558018f2528f8caaa79994a2af2abeed947f914145872ef72988b241e11925c799db0de9ec51fd9baecd2b08150240b22f91e2e55a45194 WHIRLPOOL a2b4f1c4825f2b774c2290cccd9d552bb7566ec9eb5988d3ab619d7870a907600f67e7af39fbc3e245606db8534f114c990145789c383206d3a9cf96cf043d8c
40 DIST libtirpc-1.0.1.tar.bz2 495125 SHA256 5156974f31be7ccbc8ab1de37c4739af6d9d42c87b1d5caf4835dda75fcbb89e SHA512 c9b449e737bc2bd3d56e31e8352f312e89a7ec2a11b73b5ac314e7d82d3b644c611e422b623912453b67b668f86a6de7bb7f18c9495dd15de8e2798ec2ff41c8 WHIRLPOOL cce6a4e69bd634b40d66594a81c23d2044b63eec16d6c96d6fcfaa7f2ca41fb9af99c8e2b964ec12be82682afa4090b218d7e14399fdfc9b32df6c2234bc3c9e
41 DIST libtirpc-glibc-nfs.tar.xz 8948 SHA256 2677cfedf626f3f5a8f6e507aed5bb8f79a7453b589d684dbbc086e755170d83 SHA512 90255bf0a27af16164e0710dd940778609925d473f4343093ff19d98cc4f23023788bf4edf0178eae1961afc0ba8b69b273de95b7d7e2afdb706701d8ba6f7ba WHIRLPOOL 06bcf3fd4e424a86071e5c4ddeb89aa571c862e765aae9382d9f9a55ab72cd1c623490555c1a9bd3380a2d04ecb10fb47a75a7dddf449d4368a1a01617226858
42 EBUILD libtirpc-0.2.5.ebuild 1899 SHA256 3623a04c9092a9a6dd668d70ac741ee55aeeab2c6d757e2c053bc78b833f3e97 SHA512 f25fe58b1d5aaa510350199d4ad7dc5d2956aaa35989a25da88215e9a9d446819b7e6ca788fef989892130cd1ee4baae68d87d6d6d7fd59596e4c6d484d53aa1 WHIRLPOOL 4da3882bee772b029e95fe3bc6c94f7e9cd30ff47cfd8e6537494e74e9423d4d8fd9e7248f1c019042812fe75d086ae4fb24f3531b146b0b8dd91ad547c7d295
43 -EBUILD libtirpc-1.0.1-r1.ebuild 1510 SHA256 646fc1d6c278f78d3e6bb2fc5a2a721904a988957c74d333e745dddfc1d9a1fb SHA512 3921cefb7f47e8a41d35a00a0514519401efaee39636af2ba55a3d9fe49966b3522fcdf46f4422f2cffedf96acbb90fb140c7721b554961416c47f875217a48d WHIRLPOOL c7c62d749213adb69ada4158f09d2d66b7d23088fb63c5d73fef6ae6ed83ca9ef4a7ab00e3bab8f8f2b2025d14af1e6596ae189c322c34857b02b7b90d774446
44 +EBUILD libtirpc-1.0.1-r1.ebuild 1501 SHA256 819b3f7246eb4af6832d7f3ac8ea4ec8ff4308d2c0d594bd2911662a329a09a3 SHA512 69ffef74821ee6f82f4a7427551d8564603f10df32faaf6e7747468e0ea92e3f6ceb8ea6407960e8f5f67d4d387a54747f0c508ac98a919b613221371ad27943 WHIRLPOOL b388716fd19206e0e7cb78797e927f9b6a70a53e6f1fc660cbf6f1d6adf0d4f307931c93dc8182bcaeb095cd0058b26089dee2a1187a3d1db3e02cac4bd7f4df
45 +EBUILD libtirpc-1.0.1-r2.ebuild 1887 SHA256 26fb1034f5a509486be4e2f2608630a8a448b7f4e61361bfb7d4fc0173220e60 SHA512 9b99f89e2a573fea295332a174e70c19cb633350bbf3c8076c06f7ab10fff6f3548faeaad62b225a39bda0d4a281f191be618a4289a312021ac11be3955ba9f4 WHIRLPOOL c2639ac9a48f23a629fa7fcecbd81dc2cb75a9a1e97ed8d7552261199cbf465a76ea625527eb1fcd419612b1895dcbcd3abbdb3b08d86332f6e7d69c9bccedb9
46 EBUILD libtirpc-1.0.1.ebuild 1438 SHA256 0f072addbde3ed907efd658759cb39cf61769760ef13f9d08cb4e24e0a12422f SHA512 b98ac6adaf451cad9e9bb5376ccf44e6386d9b2949786258c11871315a18fb8f0c03b1473e00c78f44e8b671c0825807dde98d0b643f5dcbca6ee6c1127731bd WHIRLPOOL 74b7d1382ae2fc5f90e17e43e5b99954402b856b28f209973b0a5c76ea99d4eeafcc5b06e210745f56e6ebbbc3b606af0ffcd7d522d110b28e88d8ad8bc88f25
47 MISC metadata.xml 335 SHA256 02e9487e791e2d6aa99e74025dd90a6c54d86c73d530c96316e93f7552e1439a SHA512 d6dd857293827907e545dc6e8631d06682d20e13442f8ce6cbd2e2a789d885c8a788f4ed1d062a8c54c4165d22eb096279d4c2f598e462a57faaf8bec1e9777b WHIRLPOOL 6a802fc6b1fdd5bc815c4d2d41de0cba5cff351cdd1fa80021c02233b3facf21674d94ec7b822c2d514e5e1c721cf3ae2b88c885afdce8a7b60d2e63da71183c
48
49 diff --git a/net-libs/libtirpc/files/libtirpc-1.0.1_add-des_impl-c-7f6bb9a3467a.patch b/net-libs/libtirpc/files/libtirpc-1.0.1_add-des_impl-c-7f6bb9a3467a.patch
50 new file mode 100644
51 index 0000000..a62f23d
52 --- /dev/null
53 +++ b/net-libs/libtirpc/files/libtirpc-1.0.1_add-des_impl-c-7f6bb9a3467a.patch
54 @@ -0,0 +1,29 @@
55 +From: Thorsten Kukuk <kukuk@×××××××.de>
56 +Date: Mon, 4 Apr 2016 13:48:04 +0000 (-0400)
57 +Subject: Compile des_crypt.c and des_impl.c
58 +X-Git-Tag: libtirpc-1-0-2-rc3~1
59 +X-Git-Url: http://git.linux-nfs.org/?p=steved%2Flibtirpc.git;a=commitdiff_plain;h=7f6bb9a3467a57caf43425d213a06aeb7870086b
60 +
61 +Compile des_crypt.c and des_impl.c
62 +
63 +Add des_impl.c to become independent of deprecated functions of glibc
64 +
65 +Fixes: f17b44048003 ('Revert commit c0547c56dafb')
66 +Signed-off-by: Thorsten Kukuk <kukuk@×××××××.de>
67 +Signed-off-by: Steve Dickson <steved@××××××.com>
68 +---
69 +
70 +diff --git a/src/Makefile.am b/src/Makefile.am
71 +index e4ed8aa..fba2aa4 100644
72 +--- a/src/Makefile.am
73 ++++ b/src/Makefile.am
74 +@@ -24,7 +24,7 @@ libtirpc_la_SOURCES = auth_none.c auth_unix.c authunix_prot.c bindresvport.c cln
75 + rpcb_st_xdr.c svc.c svc_auth.c svc_dg.c svc_auth_unix.c svc_auth_none.c \
76 + svc_auth_des.c \
77 + svc_generic.c svc_raw.c svc_run.c svc_simple.c svc_vc.c getpeereid.c \
78 +- auth_time.c auth_des.c authdes_prot.c debug.c
79 ++ auth_time.c auth_des.c authdes_prot.c debug.c des_crypt.c des_impl.c
80 +
81 + ## XDR
82 + libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_reference.c xdr_stdio.c xdr_sizeof.c
83 +
84
85 diff --git a/net-libs/libtirpc/files/libtirpc-1.0.1_ifdef-out-yp-headers-742bbdff6ddf.patch b/net-libs/libtirpc/files/libtirpc-1.0.1_ifdef-out-yp-headers-742bbdff6ddf.patch
86 new file mode 100644
87 index 0000000..481ace7
88 --- /dev/null
89 +++ b/net-libs/libtirpc/files/libtirpc-1.0.1_ifdef-out-yp-headers-742bbdff6ddf.patch
90 @@ -0,0 +1,30 @@
91 +From: Thorsten Kukuk <kukuk@×××××××.de>
92 +Date: Mon, 4 Apr 2016 13:37:32 +0000 (-0400)
93 +Subject: getpublickey.c: ifdef out yp headers
94 +X-Git-Tag: libtirpc-1-0-2-rc3~3
95 +X-Git-Url: http://git.linux-nfs.org/?p=steved%2Flibtirpc.git;a=commitdiff_plain;h=742bbdff6ddff4dde0d610a842cd8ac0408af0a0
96 +
97 +getpublickey.c: ifdef out yp headers
98 +
99 +If we don't compile in YP support, don't include YP
100 +
101 +Signed-off-by: Thorsten Kukuk <kukuk@×××××××.de>
102 +Signed-off-by: Steve Dickson <steved@××××××.com>
103 +---
104 +
105 +diff --git a/src/getpublickey.c b/src/getpublickey.c
106 +index 764a5f9..8cf4dc2 100644
107 +--- a/src/getpublickey.c
108 ++++ b/src/getpublickey.c
109 +@@ -38,8 +38,10 @@
110 + #include <pwd.h>
111 + #include <rpc/rpc.h>
112 + #include <rpc/key_prot.h>
113 ++#ifdef YP
114 + #include <rpcsvc/yp_prot.h>
115 + #include <rpcsvc/ypclnt.h>
116 ++#endif
117 + #include <string.h>
118 + #include <stdlib.h>
119 +
120 +
121
122 diff --git a/net-libs/libtirpc/files/libtirpc-1.0.1_remove-des-deps-to-glibc-503ac2e9fa56.patch b/net-libs/libtirpc/files/libtirpc-1.0.1_remove-des-deps-to-glibc-503ac2e9fa56.patch
123 new file mode 100644
124 index 0000000..0ef1529
125 --- /dev/null
126 +++ b/net-libs/libtirpc/files/libtirpc-1.0.1_remove-des-deps-to-glibc-503ac2e9fa56.patch
127 @@ -0,0 +1,43 @@
128 +From: Thorsten Kukuk <kukuk@×××××××.de>
129 +Date: Mon, 4 Apr 2016 13:51:15 +0000 (-0400)
130 +Subject: Remove des*.c dependencies to glibc
131 +X-Git-Tag: libtirpc-1-0-2-rc3
132 +X-Git-Url: http://git.linux-nfs.org/?p=steved%2Flibtirpc.git;a=commitdiff_plain;h=503ac2e9fa569d95e366766202a7ca840e28b28a
133 +
134 +Remove des*.c dependencies to glibc
135 +
136 +Our des_impl.c has dependencies to glibc header files
137 +and different arguments then our header file has.
138 +Bring our own code in sync.
139 +
140 +Signed-off-by: Thorsten Kukuk <kukuk@×××××××.de>
141 +Signed-off-by: Steve Dickson <steved@××××××.com>
142 +---
143 +
144 +diff --git a/src/des_impl.c b/src/des_impl.c
145 +index c5b7ed6..9dbccaf 100644
146 +--- a/src/des_impl.c
147 ++++ b/src/des_impl.c
148 +@@ -6,7 +6,8 @@
149 + /* see <http://www.gnu.org/licenses/> to obtain a copy. */
150 + #include <string.h>
151 + #include <stdint.h>
152 +-#include <rpc/rpc_des.h>
153 ++#include <sys/types.h>
154 ++#include <rpc/des.h>
155 +
156 +
157 + static const uint32_t des_SPtrans[8][64] =
158 +diff --git a/tirpc/rpc/des.h b/tirpc/rpc/des.h
159 +index d2881ad..018aa48 100644
160 +--- a/tirpc/rpc/des.h
161 ++++ b/tirpc/rpc/des.h
162 +@@ -82,6 +82,6 @@ struct desparams {
163 + /*
164 + * Software DES.
165 + */
166 +-extern int _des_crypt( char *, int, struct desparams * );
167 ++extern int _des_crypt( char *, unsigned, struct desparams * );
168 +
169 + #endif
170 +
171
172 diff --git a/net-libs/libtirpc/files/libtirpc-1.0.1_remove-nis-h-dep-5f00f8c78c5d.patch b/net-libs/libtirpc/files/libtirpc-1.0.1_remove-nis-h-dep-5f00f8c78c5d.patch
173 new file mode 100644
174 index 0000000..a8ad182
175 --- /dev/null
176 +++ b/net-libs/libtirpc/files/libtirpc-1.0.1_remove-nis-h-dep-5f00f8c78c5d.patch
177 @@ -0,0 +1,137 @@
178 +From: Thorsten Kukuk <kukuk@×××××××.de>
179 +Date: Mon, 4 Apr 2016 13:44:19 +0000 (-0400)
180 +Subject: Remove dependency to nis.h
181 +X-Git-Tag: libtirpc-1-0-2-rc3~2
182 +X-Git-Url: http://git.linux-nfs.org/?p=steved%2Flibtirpc.git;a=commitdiff_plain;h=5f00f8c78c5d13437d50c0737ce77ad67fd4361d
183 +
184 +Remove dependency to nis.h
185 +
186 +libtirpc needs rpcsvc/nis.h for compiling, but does not
187 +provide this head file. It's only provided by glibc,
188 +if the sunrpc code is not marked as deprecated, and
189 +by libnsl. But libnsl needs libtirpc to compile...
190 +
191 +Signed-off-by: Steve Dickson <steved@××××××.com>
192 +---
193 +
194 +diff --git a/src/auth_des.c b/src/auth_des.c
195 +index 4d3639e..af2f61f 100644
196 +--- a/src/auth_des.c
197 ++++ b/src/auth_des.c
198 +@@ -46,8 +46,8 @@
199 + #include <rpc/clnt.h>
200 + #include <rpc/xdr.h>
201 + #include <sys/socket.h>
202 +-#undef NIS
203 +-#include <rpcsvc/nis.h>
204 ++
205 ++#include "nis.h"
206 +
207 + #if defined(LIBC_SCCS) && !defined(lint)
208 + #endif
209 +diff --git a/src/auth_time.c b/src/auth_time.c
210 +index 10e58eb..7f83ab4 100644
211 +--- a/src/auth_time.c
212 ++++ b/src/auth_time.c
213 +@@ -44,8 +44,8 @@
214 + #include <rpc/rpcb_prot.h>
215 + //#include <clnt_soc.h>
216 + #include <sys/select.h>
217 +-#undef NIS
218 +-#include <rpcsvc/nis.h>
219 ++
220 ++#include "nis.h"
221 +
222 +
223 + #ifdef TESTING
224 +diff --git a/src/nis.h b/src/nis.h
225 +new file mode 100644
226 +index 0000000..588c041
227 +--- /dev/null
228 ++++ b/src/nis.h
229 +@@ -0,0 +1,70 @@
230 ++/*
231 ++ * Copyright (c) 2010, Oracle America, Inc.
232 ++ *
233 ++ * Redistribution and use in source and binary forms, with or without
234 ++ * modification, are permitted provided that the following conditions are
235 ++ * met:
236 ++ *
237 ++ * * Redistributions of source code must retain the above copyright
238 ++ * notice, this list of conditions and the following disclaimer.
239 ++ * * Redistributions in binary form must reproduce the above
240 ++ * copyright notice, this list of conditions and the following
241 ++ * disclaimer in the documentation and/or other materials
242 ++ * provided with the distribution.
243 ++ * * Neither the name of the "Oracle America, Inc." nor the names of its
244 ++ * contributors may be used to endorse or promote products derived
245 ++ * from this software without specific prior written permission.
246 ++ *
247 ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
248 ++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
249 ++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
250 ++ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
251 ++ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
252 ++ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
253 ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
254 ++ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
255 ++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
256 ++ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
257 ++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
258 ++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
259 ++ */
260 ++
261 ++#ifndef _INTERNAL_NIS_H
262 ++#define _INTERNAL_NIS_H 1
263 ++
264 ++/* This file only contains the definition of nis_server, to be
265 ++ able to compile libtirpc without the need to have a glibc
266 ++ with sunrpc or a libnsl already installed. */
267 ++
268 ++#define NIS_PK_NONE 0
269 ++
270 ++struct nis_attr {
271 ++ char *zattr_ndx;
272 ++ struct {
273 ++ u_int zattr_val_len;
274 ++ char *zattr_val_val;
275 ++ } zattr_val;
276 ++};
277 ++typedef struct nis_attr nis_attr;
278 ++
279 ++typedef char *nis_name;
280 ++
281 ++struct endpoint {
282 ++ char *uaddr;
283 ++ char *family;
284 ++ char *proto;
285 ++};
286 ++typedef struct endpoint endpoint;
287 ++
288 ++struct nis_server {
289 ++ nis_name name;
290 ++ struct {
291 ++ u_int ep_len;
292 ++ endpoint *ep_val;
293 ++ } ep;
294 ++ uint32_t key_type;
295 ++ netobj pkey;
296 ++};
297 ++typedef struct nis_server nis_server;
298 ++
299 ++#endif /* ! _INTERNAL_NIS_H */
300 +diff --git a/src/rpc_soc.c b/src/rpc_soc.c
301 +index 1ec7b3f..ed0892a 100644
302 +--- a/src/rpc_soc.c
303 ++++ b/src/rpc_soc.c
304 +@@ -61,8 +61,8 @@
305 + #include <string.h>
306 + #include <unistd.h>
307 + #include <fcntl.h>
308 +-#include <rpcsvc/nis.h>
309 +
310 ++#include "nis.h"
311 + #include "rpc_com.h"
312 +
313 + extern mutex_t rpcsoc_lock;
314 +
315
316 diff --git a/net-libs/libtirpc/files/libtirpc-1.0.1_uclibc-dont-use-struct-rpcent.patch b/net-libs/libtirpc/files/libtirpc-1.0.1_uclibc-dont-use-struct-rpcent.patch
317 new file mode 100644
318 index 0000000..b2760d2
319 --- /dev/null
320 +++ b/net-libs/libtirpc/files/libtirpc-1.0.1_uclibc-dont-use-struct-rpcent.patch
321 @@ -0,0 +1,51 @@
322 +From https://patchwork.kernel.org/patch/5499671/:
323 +
324 + Subject: [6/9] Define struct rpcent on non GNU libc
325 + From: Natanael Copa <ncopa@×××××××××××.org>
326 + X-Patchwork-Id: 5499671
327 + Message-Id: <1418718540-13667-7-git-send-email-ncopa@×××××××××××.org>
328 + To: libtirpc-devel@×××××××××××××××××.net
329 + Cc: linux-nfs@×××××××××××.org, Natanael Copa <ncopa@×××××××××××.org>
330 + Date: Tue, 16 Dec 2014 09:28:57 +0100
331 +
332 + This fixes the following compile error with musl libc:
333 + getrpcent.c:65:16: error: field 'rpc' has incomplete type
334 + struct rpcent rpc;
335 + ^
336 +
337 + Signed-off-by: Natanael Copa <ncopa@×××××××××××.org>
338 + ---
339 + This patch could probably be better. It assumes that only GNU libc has
340 + the rpcent struct defined, but the BSDs probably has it too.
341 +
342 + I am not sure if uClibc has it, but uClibc does define __GLIBC__ so it
343 + might be broken there too.
344 +
345 + I looked into using AC_CHECK_MEMBER but I don't think it is a good idea
346 + so depend on config.h since this is a header that will be installed on
347 + the system.
348 +
349 + I also found out that struct rpcent is also defined in
350 + /usr/include/gssrpc/netdb.h but I am unsure if we can depend on that
351 + too since GSS is optional.
352 +
353 + So I am a bit in doubt what the proper fix is. Meanwhile, this works
354 + for musl libc.
355 +
356 +We fix the uClibc case by checking for __UCLIBC__ as well, since uClibc will
357 +define __GLIBC__ as well (why?) as __UCLIBC__. This should not affect the
358 +musl case.
359 +---
360 +
361 +diff -Naurp libtirpc-1.0.1.orig/tirpc/rpc/rpcent.h libtirpc-1.0.1/tirpc/rpc/rpcent.h
362 +--- libtirpc-1.0.1.orig/tirpc/rpc/rpcent.h 2015-10-30 15:15:14.000000000 +0000
363 ++++ libtirpc-1.0.1/tirpc/rpc/rpcent.h 2017-07-05 04:58:27.141468000 +0000
364 +@@ -49,7 +49,7 @@ extern "C" {
365 + #endif
366 +
367 + /* These are defined in /usr/include/rpc/netdb.h */
368 +-#if !defined(__GLIBC__)
369 ++#if !defined(__GLIBC__) || defined(__UCLIBC__)
370 + struct rpcent {
371 + char *r_name; /* name of server for this rpc program */
372 + char **r_aliases; /* alias list */
373
374 diff --git a/net-libs/libtirpc/files/libtirpc-1.0.1_uclibc-use-memset-not-bzero.patch b/net-libs/libtirpc/files/libtirpc-1.0.1_uclibc-use-memset-not-bzero.patch
375 new file mode 100644
376 index 0000000..f7657f7
377 --- /dev/null
378 +++ b/net-libs/libtirpc/files/libtirpc-1.0.1_uclibc-use-memset-not-bzero.patch
379 @@ -0,0 +1,21 @@
380 +Inspired by a similar fix here:
381 +http://git.yoctoproject.org/cgit.cgi/poky/plain/meta/packages/nfs-utils/files/uclibc_bzero_fix.patch?id=39d8c0fc4a9d14b7bad1442e05c536e28b196a47
382 +
383 +Because uclibc does not have a working implementation of `__bzero'.
384 +---
385 +
386 +diff -Naurp libtirpc-1.0.1.orig/src/des_impl.c libtirpc-1.0.1/src/des_impl.c
387 +--- libtirpc-1.0.1.orig/src/des_impl.c 2017-07-05 06:16:07.441468000 +0000
388 ++++ libtirpc-1.0.1/src/des_impl.c 2017-07-05 06:19:57.351468000 +0000
389 +@@ -588,7 +588,11 @@ _des_crypt (char *buf, unsigned len, str
390 + }
391 + tin0 = tin1 = tout0 = tout1 = xor0 = xor1 = 0;
392 + tbuf[0] = tbuf[1] = 0;
393 ++#ifndef __UCLIBC__
394 + __bzero (schedule, sizeof (schedule));
395 ++#else
396 ++ memset (schedule, 0, sizeof (schedule));
397 ++#endif
398 +
399 + return (1);
400 + }
401
402 diff --git a/net-libs/libtirpc/files/musl-1.0.1_r2.patch b/net-libs/libtirpc/files/musl-1.0.1_r2.patch
403 new file mode 100644
404 index 0000000..cc3a47a
405 --- /dev/null
406 +++ b/net-libs/libtirpc/files/musl-1.0.1_r2.patch
407 @@ -0,0 +1,647 @@
408 +diff -Naur libtirpc-1.0.1.orig/src/auth_gss.c libtirpc-1.0.1/src/auth_gss.c
409 +--- libtirpc-1.0.1.orig/src/auth_gss.c 2017-07-06 11:02:13.298086863 -0700
410 ++++ libtirpc-1.0.1/src/auth_gss.c 2017-07-06 11:02:24.753213878 -0700
411 +@@ -526,6 +526,14 @@
412 + gr.gr_major != GSS_S_CONTINUE_NEEDED)) {
413 + options_ret->major_status = gr.gr_major;
414 + options_ret->minor_status = gr.gr_minor;
415 ++ if (call_stat != RPC_SUCCESS) {
416 ++ struct rpc_err err;
417 ++ clnt_geterr(gd->clnt, &err);
418 ++ LIBTIRPC_DEBUG(1, ("authgss_refresh: %s errno: %s",
419 ++ clnt_sperrno(call_stat), strerror(err.re_errno)));
420 ++ } else
421 ++ gss_log_status("authgss_refresh:",
422 ++ gr.gr_major, gr.gr_minor);
423 + return FALSE;
424 + }
425 +
426 +diff -Naur libtirpc-1.0.1.orig/src/clnt_vc.c libtirpc-1.0.1/src/clnt_vc.c
427 +--- libtirpc-1.0.1.orig/src/clnt_vc.c 2017-07-06 11:02:13.296086841 -0700
428 ++++ libtirpc-1.0.1/src/clnt_vc.c 2017-07-06 11:02:24.754213889 -0700
429 +@@ -72,6 +72,8 @@
430 + #define CMGROUP_MAX 16
431 + #define SCM_CREDS 0x03 /* process creds (struct cmsgcred) */
432 +
433 ++#undef rpc_createerr /* make it clear it is a thread safe variable */
434 ++
435 + /*
436 + * Credentials structure, used to verify the identity of a peer
437 + * process that has sent us a message. This is allocated by the
438 +@@ -188,10 +190,11 @@
439 + cl = (CLIENT *)mem_alloc(sizeof (*cl));
440 + ct = (struct ct_data *)mem_alloc(sizeof (*ct));
441 + if ((cl == (CLIENT *)NULL) || (ct == (struct ct_data *)NULL)) {
442 ++ struct rpc_createerr *ce = &get_rpc_createerr();
443 ++ ce->cf_stat = RPC_SYSTEMERROR;
444 ++ ce->cf_error.re_errno = errno;
445 + (void) syslog(LOG_ERR, clnt_vc_errstr,
446 + clnt_vc_str, __no_mem_str);
447 +- rpc_createerr.cf_stat = RPC_SYSTEMERROR;
448 +- rpc_createerr.cf_error.re_errno = errno;
449 + goto err;
450 + }
451 + ct->ct_addr.buf = NULL;
452 +@@ -230,26 +233,29 @@
453 + assert(vc_cv != (cond_t *) NULL);
454 +
455 + /*
456 +- * XXX - fvdl connecting while holding a mutex?
457 ++ * Do not hold mutex during connect
458 + */
459 ++ mutex_unlock(&clnt_fd_lock);
460 ++
461 + slen = sizeof ss;
462 + if (getpeername(fd, (struct sockaddr *)&ss, &slen) < 0) {
463 + if (errno != ENOTCONN) {
464 +- rpc_createerr.cf_stat = RPC_SYSTEMERROR;
465 +- rpc_createerr.cf_error.re_errno = errno;
466 +- mutex_unlock(&clnt_fd_lock);
467 ++ struct rpc_createerr *ce = &get_rpc_createerr();
468 ++ ce->cf_stat = RPC_SYSTEMERROR;
469 ++ ce->cf_error.re_errno = errno;
470 + thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
471 + goto err;
472 + }
473 + if (connect(fd, (struct sockaddr *)raddr->buf, raddr->len) < 0){
474 +- rpc_createerr.cf_stat = RPC_SYSTEMERROR;
475 +- rpc_createerr.cf_error.re_errno = errno;
476 +- mutex_unlock(&clnt_fd_lock);
477 +- thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
478 +- goto err;
479 ++ if (errno != EISCONN) {
480 ++ struct rpc_createerr *ce = &get_rpc_createerr();
481 ++ ce->cf_stat = RPC_SYSTEMERROR;
482 ++ ce->cf_error.re_errno = errno;
483 ++ thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
484 ++ goto err;
485 ++ }
486 + }
487 + }
488 +- mutex_unlock(&clnt_fd_lock);
489 + if (!__rpc_fd2sockinfo(fd, &si))
490 + goto err;
491 + thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
492 +diff -Naur libtirpc-1.0.1.orig/src/des_impl.c libtirpc-1.0.1/src/des_impl.c
493 +--- libtirpc-1.0.1.orig/src/des_impl.c 2017-07-06 11:02:13.300086885 -0700
494 ++++ libtirpc-1.0.1/src/des_impl.c 2017-07-06 11:04:00.778278610 -0700
495 +@@ -588,7 +588,7 @@
496 + }
497 + tin0 = tin1 = tout0 = tout1 = xor0 = xor1 = 0;
498 + tbuf[0] = tbuf[1] = 0;
499 +-#ifndef __UCLIBC__
500 ++#if defined(__GLIBC__) && !defined(__UCLIBC__)
501 + __bzero (schedule, sizeof (schedule));
502 + #else
503 + memset (schedule, 0, sizeof (schedule));
504 +diff -Naur libtirpc-1.0.1.orig/src/getrpcport.c libtirpc-1.0.1/src/getrpcport.c
505 +--- libtirpc-1.0.1.orig/src/getrpcport.c 2017-07-06 11:02:13.293086807 -0700
506 ++++ libtirpc-1.0.1/src/getrpcport.c 2017-07-06 11:02:24.754213889 -0700
507 +@@ -57,8 +57,8 @@
508 + memset(&addr, 0, sizeof(addr));
509 + addr.sin_family = AF_INET;
510 + addr.sin_port = 0;
511 +- if (hp->h_length > sizeof(addr))
512 +- hp->h_length = sizeof(addr);
513 ++ if (hp->h_length > sizeof(addr.sin_addr.s_addr))
514 ++ hp->h_length = sizeof(addr.sin_addr.s_addr);
515 + memcpy(&addr.sin_addr.s_addr, hp->h_addr, (size_t)hp->h_length);
516 + /* Inconsistent interfaces need casts! :-( */
517 + return (pmap_getport(&addr, (u_long)prognum, (u_long)versnum,
518 +diff -Naur libtirpc-1.0.1.orig/src/rpc_dtablesize.c libtirpc-1.0.1/src/rpc_dtablesize.c
519 +--- libtirpc-1.0.1.orig/src/rpc_dtablesize.c 2017-07-06 11:02:13.290086774 -0700
520 ++++ libtirpc-1.0.1/src/rpc_dtablesize.c 2017-07-06 11:02:24.754213889 -0700
521 +@@ -27,22 +27,14 @@
522 + */
523 +
524 + #include <unistd.h>
525 +-
526 + #include <sys/select.h>
527 +-
528 +-int _rpc_dtablesize(void); /* XXX */
529 ++#include <rpc/clnt.h>
530 ++#include <rpc/rpc_com.h>
531 +
532 + /*
533 + * Cache the result of getdtablesize(), so we don't have to do an
534 + * expensive system call every time.
535 + */
536 +-/*
537 +- * XXX In FreeBSD 2.x, you can have the maximum number of open file
538 +- * descriptors be greater than FD_SETSIZE (which us 256 by default).
539 +- *
540 +- * Since old programs tend to use this call to determine the first arg
541 +- * for _select(), having this return > FD_SETSIZE is a Bad Idea(TM)!
542 +- */
543 + int
544 + _rpc_dtablesize(void)
545 + {
546 +diff -Naur libtirpc-1.0.1.orig/src/rtime.c libtirpc-1.0.1/src/rtime.c
547 +--- libtirpc-1.0.1.orig/src/rtime.c 2017-07-06 11:02:13.290086774 -0700
548 ++++ libtirpc-1.0.1/src/rtime.c 2017-07-06 11:02:24.755213900 -0700
549 +@@ -46,6 +46,7 @@
550 + #include <unistd.h>
551 + #include <errno.h>
552 + #include <sys/types.h>
553 ++#include <sys/poll.h>
554 + #include <sys/socket.h>
555 + #include <sys/time.h>
556 + #include <netinet/in.h>
557 +@@ -67,7 +68,8 @@
558 + struct timeval *timeout;
559 + {
560 + int s;
561 +- fd_set readfds;
562 ++ struct pollfd fd;
563 ++ int milliseconds;
564 + int res;
565 + unsigned long thetime;
566 + struct sockaddr_in from;
567 +@@ -94,31 +96,32 @@
568 + addrp->sin_port = serv->s_port;
569 +
570 + if (type == SOCK_DGRAM) {
571 +- res = sendto(s, (char *)&thetime, sizeof(thetime), 0,
572 ++ res = sendto(s, (char *)&thetime, sizeof(thetime), 0,
573 + (struct sockaddr *)addrp, sizeof(*addrp));
574 + if (res < 0) {
575 + do_close(s);
576 +- return(-1);
577 ++ return(-1);
578 + }
579 +- do {
580 +- FD_ZERO(&readfds);
581 +- FD_SET(s, &readfds);
582 +- res = select(_rpc_dtablesize(), &readfds,
583 +- (fd_set *)NULL, (fd_set *)NULL, timeout);
584 +- } while (res < 0 && errno == EINTR);
585 ++
586 ++ milliseconds = (timeout->tv_sec * 1000) + (timeout->tv_usec / 1000);
587 ++ fd.fd = s;
588 ++ fd.events = POLLIN;
589 ++ do
590 ++ res = poll (&fd, 1, milliseconds);
591 ++ while (res < 0 && errno == EINTR);
592 + if (res <= 0) {
593 + if (res == 0) {
594 + errno = ETIMEDOUT;
595 + }
596 + do_close(s);
597 +- return(-1);
598 ++ return(-1);
599 + }
600 + fromlen = sizeof(from);
601 +- res = recvfrom(s, (char *)&thetime, sizeof(thetime), 0,
602 ++ res = recvfrom(s, (char *)&thetime, sizeof(thetime), 0,
603 + (struct sockaddr *)&from, &fromlen);
604 + do_close(s);
605 + if (res < 0) {
606 +- return(-1);
607 ++ return(-1);
608 + }
609 + } else {
610 + if (connect(s, (struct sockaddr *)addrp, sizeof(*addrp)) < 0) {
611 +diff -Naur libtirpc-1.0.1.orig/src/svc.c libtirpc-1.0.1/src/svc.c
612 +--- libtirpc-1.0.1.orig/src/svc.c 2017-07-06 11:02:13.290086774 -0700
613 ++++ libtirpc-1.0.1/src/svc.c 2017-07-06 11:02:24.755213900 -0700
614 +@@ -99,7 +99,7 @@
615 + {
616 + __svc_xports = (SVCXPRT **) calloc (_rpc_dtablesize(), sizeof (SVCXPRT *));
617 + if (__svc_xports == NULL)
618 +- return;
619 ++ goto unlock;
620 + }
621 + if (sock < _rpc_dtablesize())
622 + {
623 +@@ -120,14 +120,14 @@
624 + svc_pollfd[i].fd = sock;
625 + svc_pollfd[i].events = (POLLIN | POLLPRI |
626 + POLLRDNORM | POLLRDBAND);
627 +- return;
628 ++ goto unlock;
629 + }
630 +
631 + new_svc_pollfd = (struct pollfd *) realloc (svc_pollfd,
632 + sizeof (struct pollfd)
633 + * (svc_max_pollfd + 1));
634 + if (new_svc_pollfd == NULL) /* Out of memory */
635 +- return;
636 ++ goto unlock;
637 + svc_pollfd = new_svc_pollfd;
638 + ++svc_max_pollfd;
639 +
640 +@@ -135,6 +135,7 @@
641 + svc_pollfd[svc_max_pollfd - 1].events = (POLLIN | POLLPRI |
642 + POLLRDNORM | POLLRDBAND);
643 + }
644 ++unlock:
645 + rwlock_unlock (&svc_fd_lock);
646 + }
647 +
648 +diff -Naur libtirpc-1.0.1.orig/src/svc_auth_des.c libtirpc-1.0.1/src/svc_auth_des.c
649 +--- libtirpc-1.0.1.orig/src/svc_auth_des.c 2017-07-06 11:02:13.289086763 -0700
650 ++++ libtirpc-1.0.1/src/svc_auth_des.c 2017-07-06 11:02:24.756213911 -0700
651 +@@ -86,13 +86,13 @@
652 + static short *authdes_lru/* [AUTHDES_CACHESZ] */;
653 +
654 + static void cache_init(); /* initialize the cache */
655 +-static short cache_spot(); /* find an entry in the cache */
656 +-static void cache_ref(/*short sid*/); /* note that sid was ref'd */
657 ++static short cache_spot(des_block *key, char *name, struct timeval *timestamp); /* find an entry in the cache */
658 ++static void cache_ref(short sid); /* note that sid was ref'd */
659 +
660 +-static void invalidate(); /* invalidate entry in cache */
661 ++static void invalidate(char *cred); /* invalidate entry in cache */
662 +
663 + /*
664 +- * cache statistics
665 ++ * cache statistics
666 + */
667 + static struct {
668 + u_long ncachehits; /* times cache hit, and is not replay */
669 +diff -Naur libtirpc-1.0.1.orig/src/svc_auth_gss.c libtirpc-1.0.1/src/svc_auth_gss.c
670 +--- libtirpc-1.0.1.orig/src/svc_auth_gss.c 2017-07-06 11:02:13.289086763 -0700
671 ++++ libtirpc-1.0.1/src/svc_auth_gss.c 2017-07-06 11:02:24.756213911 -0700
672 +@@ -129,6 +129,8 @@
673 + ((struct svc_rpc_gss_data *)(auth)->svc_ah_private)
674 +
675 + /* Global server credentials. */
676 ++static u_int _svcauth_req_time = 0;
677 ++static gss_OID_set_desc _svcauth_oid_set = {1, GSS_C_NULL_OID };
678 + static gss_cred_id_t _svcauth_gss_creds;
679 + static gss_name_t _svcauth_gss_name = GSS_C_NO_NAME;
680 + static char * _svcauth_svc_name = NULL;
681 +@@ -167,6 +169,7 @@
682 + gss_name_t name;
683 + gss_buffer_desc namebuf;
684 + OM_uint32 maj_stat, min_stat;
685 ++ bool_t result;
686 +
687 + gss_log_debug("in svcauth_gss_import_name()");
688 +
689 +@@ -181,22 +184,21 @@
690 + maj_stat, min_stat);
691 + return (FALSE);
692 + }
693 +- if (svcauth_gss_set_svc_name(name) != TRUE) {
694 +- gss_release_name(&min_stat, &name);
695 +- return (FALSE);
696 +- }
697 +- return (TRUE);
698 ++ result = svcauth_gss_set_svc_name(name);
699 ++ gss_release_name(&min_stat, &name);
700 ++ return result;
701 + }
702 +
703 + static bool_t
704 +-svcauth_gss_acquire_cred(u_int req_time, gss_OID_set_desc *oid_set)
705 ++svcauth_gss_acquire_cred(void)
706 + {
707 + OM_uint32 maj_stat, min_stat;
708 +
709 + gss_log_debug("in svcauth_gss_acquire_cred()");
710 +
711 +- maj_stat = gss_acquire_cred(&min_stat, _svcauth_gss_name, req_time,
712 +- oid_set, GSS_C_ACCEPT,
713 ++ maj_stat = gss_acquire_cred(&min_stat, _svcauth_gss_name,
714 ++ _svcauth_req_time, &_svcauth_oid_set,
715 ++ GSS_C_ACCEPT,
716 + &_svcauth_gss_creds, NULL, NULL);
717 +
718 + if (maj_stat != GSS_S_COMPLETE) {
719 +@@ -300,6 +302,8 @@
720 + NULL,
721 + &gd->deleg);
722 +
723 ++ xdr_free((xdrproc_t)xdr_rpc_gss_init_args, (caddr_t)&recv_tok);
724 ++
725 + if (gr->gr_major != GSS_S_COMPLETE &&
726 + gr->gr_major != GSS_S_CONTINUE_NEEDED) {
727 + gss_log_status("svcauth_gss_accept_sec_context: accept_sec_context",
728 +@@ -352,8 +356,11 @@
729 + return (FALSE);
730 +
731 + rqst->rq_xprt->xp_verf.oa_flavor = RPCSEC_GSS;
732 +- rqst->rq_xprt->xp_verf.oa_base = checksum.value;
733 ++ memcpy(rqst->rq_xprt->xp_verf.oa_base, checksum.value,
734 ++ checksum.length);
735 + rqst->rq_xprt->xp_verf.oa_length = checksum.length;
736 ++
737 ++ gss_release_buffer(&min_stat, &checksum);
738 + }
739 + return (TRUE);
740 + }
741 +@@ -435,10 +442,13 @@
742 + maj_stat, min_stat);
743 + return (FALSE);
744 + }
745 ++
746 + rqst->rq_xprt->xp_verf.oa_flavor = RPCSEC_GSS;
747 +- rqst->rq_xprt->xp_verf.oa_base = (caddr_t)checksum.value;
748 ++ memcpy(rqst->rq_xprt->xp_verf.oa_base, checksum.value, checksum.length);
749 + rqst->rq_xprt->xp_verf.oa_length = (u_int)checksum.length;
750 +
751 ++ gss_release_buffer(&min_stat, &checksum);
752 ++
753 + return (TRUE);
754 + }
755 +
756 +@@ -568,6 +578,8 @@
757 + gss_qop_t qop;
758 + struct svcauth_gss_cache_entry **ce;
759 + time_t now;
760 ++ enum auth_stat result = AUTH_OK;
761 ++ OM_uint32 min_stat;
762 +
763 + gss_log_debug("in svcauth_gss()");
764 +
765 +@@ -621,19 +633,25 @@
766 + XDR_DESTROY(&xdrs);
767 +
768 + /* Check version. */
769 +- if (gc->gc_v != RPCSEC_GSS_VERSION)
770 +- return (AUTH_BADCRED);
771 ++ if (gc->gc_v != RPCSEC_GSS_VERSION) {
772 ++ result = AUTH_BADCRED;
773 ++ goto out;
774 ++ }
775 +
776 + /* Check RPCSEC_GSS service. */
777 + if (gc->gc_svc != RPCSEC_GSS_SVC_NONE &&
778 + gc->gc_svc != RPCSEC_GSS_SVC_INTEGRITY &&
779 +- gc->gc_svc != RPCSEC_GSS_SVC_PRIVACY)
780 +- return (AUTH_BADCRED);
781 ++ gc->gc_svc != RPCSEC_GSS_SVC_PRIVACY) {
782 ++ result = AUTH_BADCRED;
783 ++ goto out;
784 ++ }
785 +
786 + /* Check sequence number. */
787 + if (gd->established) {
788 +- if (gc->gc_seq > MAXSEQ)
789 +- return (RPCSEC_GSS_CTXPROBLEM);
790 ++ if (gc->gc_seq > MAXSEQ) {
791 ++ result = RPCSEC_GSS_CTXPROBLEM;
792 ++ goto out;
793 ++ }
794 +
795 + if ((offset = gd->seqlast - gc->gc_seq) < 0) {
796 + gd->seqlast = gc->gc_seq;
797 +@@ -643,7 +661,8 @@
798 + }
799 + else if (offset >= gd->win || (gd->seqmask & (1 << offset))) {
800 + *no_dispatch = 1;
801 +- return (RPCSEC_GSS_CTXPROBLEM);
802 ++ result = RPCSEC_GSS_CTXPROBLEM;
803 ++ goto out;
804 + }
805 + gd->seq = gc->gc_seq;
806 + gd->seqmask |= (1 << offset);
807 +@@ -654,35 +673,52 @@
808 + rqst->rq_svcname = (char *)gd->ctx;
809 + }
810 +
811 ++ rqst->rq_xprt->xp_verf.oa_base = msg->rm_call.cb_verf.oa_base;
812 ++
813 + /* Handle RPCSEC_GSS control procedure. */
814 + switch (gc->gc_proc) {
815 +
816 + case RPCSEC_GSS_INIT:
817 + case RPCSEC_GSS_CONTINUE_INIT:
818 +- if (rqst->rq_proc != NULLPROC)
819 +- return (AUTH_FAILED); /* XXX ? */
820 ++ if (rqst->rq_proc != NULLPROC) {
821 ++ result = AUTH_FAILED; /* XXX ? */
822 ++ break;
823 ++ }
824 +
825 + if (_svcauth_gss_name == GSS_C_NO_NAME) {
826 +- if (!svcauth_gss_import_name("nfs"))
827 +- return (AUTH_FAILED);
828 ++ if (!svcauth_gss_import_name("nfs")) {
829 ++ result = AUTH_FAILED;
830 ++ break;
831 ++ }
832 + }
833 +
834 +- if (!svcauth_gss_acquire_cred(0, GSS_C_NULL_OID_SET))
835 +- return (AUTH_FAILED);
836 ++ if (!svcauth_gss_acquire_cred()) {
837 ++ result = AUTH_FAILED;
838 ++ break;
839 ++ }
840 +
841 +- if (!svcauth_gss_accept_sec_context(rqst, &gr))
842 +- return (AUTH_REJECTEDCRED);
843 ++ if (!svcauth_gss_accept_sec_context(rqst, &gr)) {
844 ++ result = AUTH_REJECTEDCRED;
845 ++ break;
846 ++ }
847 +
848 +- if (!svcauth_gss_nextverf(rqst, htonl(gr.gr_win)))
849 +- return (AUTH_FAILED);
850 ++ if (!svcauth_gss_nextverf(rqst, htonl(gr.gr_win))) {
851 ++ result = AUTH_FAILED;
852 ++ break;
853 ++ }
854 +
855 + *no_dispatch = TRUE;
856 +
857 + call_stat = svc_sendreply(rqst->rq_xprt,
858 + (xdrproc_t)xdr_rpc_gss_init_res, (caddr_t)&gr);
859 +
860 +- if (!call_stat)
861 +- return (AUTH_FAILED);
862 ++ gss_release_buffer(&min_stat, &gr.gr_token);
863 ++ free(gr.gr_ctx.value);
864 ++
865 ++ if (!call_stat) {
866 ++ result = AUTH_FAILED;
867 ++ break;
868 ++ }
869 +
870 + if (gr.gr_major == GSS_S_COMPLETE)
871 + gd->established = TRUE;
872 +@@ -690,27 +726,37 @@
873 + break;
874 +
875 + case RPCSEC_GSS_DATA:
876 +- if (!svcauth_gss_validate(gd, msg, &qop))
877 +- return (RPCSEC_GSS_CREDPROBLEM);
878 ++ if (!svcauth_gss_validate(gd, msg, &qop)) {
879 ++ result = RPCSEC_GSS_CREDPROBLEM;
880 ++ break;
881 ++ }
882 +
883 +- if (!svcauth_gss_nextverf(rqst, htonl(gc->gc_seq)))
884 +- return (AUTH_FAILED);
885 ++ if (!svcauth_gss_nextverf(rqst, htonl(gc->gc_seq))) {
886 ++ result = AUTH_FAILED;
887 ++ break;
888 ++ }
889 +
890 + if (!gd->callback_done) {
891 + gd->callback_done = TRUE;
892 + gd->sec.qop = qop;
893 + (void)rpc_gss_num_to_qop(gd->rcred.mechanism,
894 + gd->sec.qop, &gd->rcred.qop);
895 +- if (!svcauth_gss_callback(rqst, gd))
896 +- return (AUTH_REJECTEDCRED);
897 ++ if (!svcauth_gss_callback(rqst, gd)) {
898 ++ result = AUTH_REJECTEDCRED;
899 ++ break;
900 ++ }
901 + }
902 +
903 + if (gd->locked) {
904 + if (gd->rcred.service !=
905 +- _rpc_gss_svc_to_service(gc->gc_svc))
906 +- return (AUTH_FAILED);
907 +- if (gd->sec.qop != qop)
908 +- return (AUTH_BADVERF);
909 ++ _rpc_gss_svc_to_service(gc->gc_svc)) {
910 ++ result = AUTH_FAILED;
911 ++ break;
912 ++ }
913 ++ if (gd->sec.qop != qop) {
914 ++ result = AUTH_BADVERF;
915 ++ break;
916 ++ }
917 + }
918 +
919 + if (gd->sec.qop != qop) {
920 +@@ -724,17 +770,25 @@
921 + break;
922 +
923 + case RPCSEC_GSS_DESTROY:
924 +- if (rqst->rq_proc != NULLPROC)
925 +- return (AUTH_FAILED); /* XXX ? */
926 ++ if (rqst->rq_proc != NULLPROC) {
927 ++ result = AUTH_FAILED; /* XXX ? */
928 ++ break;
929 ++ }
930 +
931 +- if (!svcauth_gss_validate(gd, msg, &qop))
932 +- return (RPCSEC_GSS_CREDPROBLEM);
933 ++ if (!svcauth_gss_validate(gd, msg, &qop)) {
934 ++ result = RPCSEC_GSS_CREDPROBLEM;
935 ++ break;
936 ++ }
937 +
938 +- if (!svcauth_gss_nextverf(rqst, htonl(gc->gc_seq)))
939 +- return (AUTH_FAILED);
940 ++ if (!svcauth_gss_nextverf(rqst, htonl(gc->gc_seq))) {
941 ++ result = AUTH_FAILED;
942 ++ break;
943 ++ }
944 +
945 +- if (!svcauth_gss_release_cred())
946 +- return (AUTH_FAILED);
947 ++ if (!svcauth_gss_release_cred()) {
948 ++ result = AUTH_FAILED;
949 ++ break;
950 ++ }
951 +
952 + SVCAUTH_DESTROY(&SVC_XP_AUTH(rqst->rq_xprt));
953 + SVC_XP_AUTH(rqst->rq_xprt).svc_ah_ops = svc_auth_none.svc_ah_ops;
954 +@@ -743,10 +797,12 @@
955 + break;
956 +
957 + default:
958 +- return (AUTH_REJECTEDCRED);
959 ++ result = AUTH_REJECTEDCRED;
960 + break;
961 + }
962 +- return (AUTH_OK);
963 ++out:
964 ++ xdr_free((xdrproc_t)xdr_rpc_gss_cred, (caddr_t)gc);
965 ++ return result;
966 + }
967 +
968 + static bool_t
969 +@@ -890,7 +946,6 @@
970 + rpc_gss_set_svc_name(char *principal, char *mechanism, u_int req_time,
971 + u_int UNUSED(program), u_int UNUSED(version))
972 + {
973 +- gss_OID_set_desc oid_set;
974 + rpc_gss_OID oid;
975 + char *save;
976 +
977 +@@ -902,14 +957,13 @@
978 +
979 + if (!rpc_gss_mech_to_oid(mechanism, &oid))
980 + goto out_err;
981 +- oid_set.count = 1;
982 +- oid_set.elements = (gss_OID)oid;
983 +
984 + if (!svcauth_gss_import_name(principal))
985 + goto out_err;
986 +- if (!svcauth_gss_acquire_cred(req_time, &oid_set))
987 +- goto out_err;
988 +
989 ++ _svcauth_req_time = req_time;
990 ++ _svcauth_oid_set.count = 1;
991 ++ _svcauth_oid_set.elements = (gss_OID)oid;
992 + free(_svcauth_svc_name);
993 + _svcauth_svc_name = save;
994 + return TRUE;
995 +diff -Naur libtirpc-1.0.1.orig/src/svc_vc.c libtirpc-1.0.1/src/svc_vc.c
996 +--- libtirpc-1.0.1.orig/src/svc_vc.c 2017-07-06 11:02:13.288086752 -0700
997 ++++ libtirpc-1.0.1/src/svc_vc.c 2017-07-06 11:02:24.757213922 -0700
998 +@@ -270,14 +270,8 @@
999 + struct cf_conn *cd;
1000 + const char *netid;
1001 + struct __rpc_sockinfo si;
1002 +-
1003 +- assert(fd != -1);
1004 +
1005 +- if (fd >= FD_SETSIZE) {
1006 +- warnx("svc_vc: makefd_xprt: fd too high\n");
1007 +- xprt = NULL;
1008 +- goto done;
1009 +- }
1010 ++ assert(fd != -1);
1011 +
1012 + xprt = mem_alloc(sizeof(SVCXPRT));
1013 + if (xprt == NULL) {
1014 +@@ -338,22 +332,10 @@
1015 + r = (struct cf_rendezvous *)xprt->xp_p1;
1016 + again:
1017 + len = sizeof addr;
1018 +- if ((sock = accept(xprt->xp_fd, (struct sockaddr *)(void *)&addr,
1019 +- &len)) < 0) {
1020 ++ sock = accept(xprt->xp_fd, (struct sockaddr *)(void *)&addr, &len);
1021 ++ if (sock < 0) {
1022 + if (errno == EINTR)
1023 + goto again;
1024 +-
1025 +- if (errno == EMFILE || errno == ENFILE) {
1026 +- /* If there are no file descriptors available, then accept will fail.
1027 +- We want to delay here so the connection request can be dequeued;
1028 +- otherwise we can bounce between polling and accepting, never
1029 +- giving the request a chance to dequeue and eating an enormous
1030 +- amount of cpu time in svc_run if we're polling on many file
1031 +- descriptors. */
1032 +- struct timespec ts = { .tv_sec = 0, .tv_nsec = 50000000 };
1033 +- nanosleep (&ts, NULL);
1034 +- goto again;
1035 +- }
1036 + return (FALSE);
1037 + }
1038 + /*
1039 +diff -Naur libtirpc-1.0.1.orig/tirpc/rpc/rpcent.h libtirpc-1.0.1/tirpc/rpc/rpcent.h
1040 +--- libtirpc-1.0.1.orig/tirpc/rpc/rpcent.h 2017-07-06 11:02:13.286086730 -0700
1041 ++++ libtirpc-1.0.1/tirpc/rpc/rpcent.h 2017-07-06 11:02:24.757213922 -0700
1042 +@@ -60,10 +60,11 @@
1043 + extern struct rpcent *getrpcbyname(const char *);
1044 + extern struct rpcent *getrpcbynumber(int);
1045 + extern struct rpcent *getrpcent(void);
1046 +-#endif
1047 +
1048 + extern void setrpcent(int);
1049 + extern void endrpcent(void);
1050 ++#endif
1051 ++
1052 + #ifdef __cplusplus
1053 + }
1054 + #endif
1055
1056 diff --git a/net-libs/libtirpc/libtirpc-1.0.1-r1.ebuild b/net-libs/libtirpc/libtirpc-1.0.1-r1.ebuild
1057 index 732930d..dea23ff 100644
1058 --- a/net-libs/libtirpc/libtirpc-1.0.1-r1.ebuild
1059 +++ b/net-libs/libtirpc/libtirpc-1.0.1-r1.ebuild
1060 @@ -12,7 +12,7 @@ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2
1061
1062 LICENSE="GPL-2"
1063 SLOT="0/3" # subslot matches SONAME major
1064 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
1065 +KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86"
1066 IUSE="ipv6 kerberos static-libs"
1067
1068 RDEPEND="kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )"
1069
1070 diff --git a/net-libs/libtirpc/libtirpc-1.0.1-r1.ebuild b/net-libs/libtirpc/libtirpc-1.0.1-r2.ebuild
1071 similarity index 76%
1072 copy from net-libs/libtirpc/libtirpc-1.0.1-r1.ebuild
1073 copy to net-libs/libtirpc/libtirpc-1.0.1-r2.ebuild
1074 index 732930d..a90754f 100644
1075 --- a/net-libs/libtirpc/libtirpc-1.0.1-r1.ebuild
1076 +++ b/net-libs/libtirpc/libtirpc-1.0.1-r2.ebuild
1077 @@ -3,7 +3,7 @@
1078
1079 EAPI="5"
1080
1081 -inherit multilib-minimal toolchain-funcs eutils
1082 +inherit autotools multilib-minimal toolchain-funcs eutils
1083
1084 DESCRIPTION="Transport Independent RPC library (SunRPC replacement)"
1085 HOMEPAGE="http://libtirpc.sourceforge.net/"
1086 @@ -23,14 +23,21 @@ DEPEND="${RDEPEND}
1087
1088 PATCHES=(
1089 "${FILESDIR}/${P}-CVE-2017-8779.patch"
1090 + "${FILESDIR}/${P}_uclibc-dont-use-struct-rpcent.patch"
1091 + "${FILESDIR}/${P}_ifdef-out-yp-headers-742bbdff6ddf.patch"
1092 + "${FILESDIR}/${P}_remove-nis-h-dep-5f00f8c78c5d.patch"
1093 + "${FILESDIR}/${P}_add-des_impl-c-7f6bb9a3467a.patch"
1094 + "${FILESDIR}/${P}_remove-des-deps-to-glibc-503ac2e9fa56.patch"
1095 + "${FILESDIR}/${P}_uclibc-use-memset-not-bzero.patch"
1096 # musl fixes
1097 - "${FILESDIR}"/git.patch
1098 + "${FILESDIR}/musl-1.0.1_r2.patch"
1099 )
1100
1101 src_prepare() {
1102 cp -r "${WORKDIR}"/tirpc "${S}"/ || die
1103 epatch "${PATCHES[@]}"
1104 epatch_user
1105 + eautoreconf
1106 }
1107
1108 multilib_src_configure() {