Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-dev:musl commit in: net-misc/openssh/files/, net-misc/openssh/
Date: Wed, 22 Jan 2014 23:01:03
Message-Id: 1390431606.18bbfa3f87143fe74e3812a8ed85f210e1563530.blueness@gentoo
1 commit: 18bbfa3f87143fe74e3812a8ed85f210e1563530
2 Author: layman <layman <AT> localhost>
3 AuthorDate: Wed Jan 22 18:02:12 2014 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 22 23:00:06 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=18bbfa3f
7
8 net-misc/openssh: fix exit(0) and header assumptions
9
10 ---
11 .../openssh/files/openssh-6.3_p1-x509-glue.patch | 16 -
12 .../openssh/files/openssh-6.4p1-avoid-exit.patch | 499 +++++++++++++++++++++
13 .../openssh-6.4p1-fix-typo-construct_utmpx.patch | 21 +
14 .../files/openssh-6.4p1-missing-sys_param_h.patch | 67 +++
15 net-misc/openssh/openssh-6.4_p1-r99.ebuild | 4 +
16 5 files changed, 591 insertions(+), 16 deletions(-)
17
18 diff --git a/net-misc/openssh/files/openssh-6.3_p1-x509-glue.patch b/net-misc/openssh/files/openssh-6.3_p1-x509-glue.patch
19 deleted file mode 100644
20 index f70d44a..0000000
21 --- a/net-misc/openssh/files/openssh-6.3_p1-x509-glue.patch
22 +++ /dev/null
23 @@ -1,16 +0,0 @@
24 -make x509 apply after openssh-5.9_p1-sshd-gssapi-multihomed.patch
25 -
26 ---- openssh-6.3p1+x509-7.6.diff
27 -+++ openssh-6.3p1+x509-7.6.diff
28 -@@ -14784,10 +14784,9 @@
29 - .It Cm ChallengeResponseAuthentication
30 - Specifies whether challenge-response authentication is allowed (e.g. via
31 - PAM or though authentication styles supported in
32 --@@ -490,6 +567,16 @@
33 -+@@ -490,5 +567,15 @@
34 - The default is
35 - .Dq yes .
36 -- Note that this option applies to protocol version 2 only.
37 - +.It Cm HostbasedAlgorithms
38 - +Specifies the protocol version 2 algorithms used in
39 - +.Dq hostbased
40
41 diff --git a/net-misc/openssh/files/openssh-6.4p1-avoid-exit.patch b/net-misc/openssh/files/openssh-6.4p1-avoid-exit.patch
42 new file mode 100644
43 index 0000000..4c02aeb
44 --- /dev/null
45 +++ b/net-misc/openssh/files/openssh-6.4p1-avoid-exit.patch
46 @@ -0,0 +1,499 @@
47 +diff -Nuar openssh-6.4p1.orig/configure.ac openssh-6.4p1/configure.ac
48 +--- openssh-6.4p1.orig/configure.ac 2014-01-22 17:05:13.463582250 +0000
49 ++++ openssh-6.4p1/configure.ac 2014-01-22 17:13:08.102608790 +0000
50 +@@ -223,7 +223,7 @@
51 + [AC_LANG_PROGRAM([[
52 + #include <stdlib.h>
53 + __attribute__((__unused__)) static void foo(void){return;}]],
54 +- [[ exit(0); ]])],
55 ++ [[ return 0; ]])],
56 + [ AC_MSG_RESULT([yes]) ],
57 + [ AC_MSG_RESULT([no])
58 + AC_DEFINE(NO_ATTRIBUTE_ON_RETURN_TYPE, 1,
59 +@@ -410,7 +410,7 @@
60 + [AC_LANG_PROGRAM([[
61 + #define testmacro foo
62 + #define testmacro bar]],
63 +- [[ exit(0); ]])],
64 ++ [[ return 0; ]])],
65 + [ AC_MSG_RESULT([yes]) ],
66 + [ AC_MSG_RESULT([no])
67 + CC="`echo $CC | sed 's/-qlanglvl\=ansi//g'`"
68 +@@ -526,9 +526,9 @@
69 + AC_MSG_CHECKING([if we have working getaddrinfo])
70 + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <mach-o/dyld.h>
71 + main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
72 +- exit(0);
73 ++ return 0;
74 + else
75 +- exit(1);
76 ++ return 1;
77 + }
78 + ]])],
79 + [AC_MSG_RESULT([working])],
80 +@@ -1016,7 +1016,7 @@
81 + esac
82 +
83 + AC_MSG_CHECKING([compiler and flags for sanity])
84 +-AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], [[ exit(0); ]])],
85 ++AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], [[ return 0; ]])],
86 + [ AC_MSG_RESULT([yes]) ],
87 + [
88 + AC_MSG_RESULT([no])
89 +@@ -1048,9 +1048,9 @@
90 + strncpy(buf,"/etc", 32);
91 + s = dirname(buf);
92 + if (!s || strncmp(s, "/", 32) != 0) {
93 +- exit(1);
94 ++ return 1;
95 + } else {
96 +- exit(0);
97 ++ return 0;
98 + }
99 + }
100 + ]])],
101 +@@ -1140,19 +1140,19 @@
102 + int a=0, b=0, c=0, d=0, n, v;
103 + n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d);
104 + if (n != 3 && n != 4)
105 +- exit(1);
106 ++ return 1;
107 + v = a*1000000 + b*10000 + c*100 + d;
108 + fprintf(stderr, "found zlib version %s (%d)\n", ZLIB_VERSION, v);
109 +
110 + /* 1.1.4 is OK */
111 + if (a == 1 && b == 1 && c >= 4)
112 +- exit(0);
113 ++ return 0;
114 +
115 + /* 1.2.3 and up are OK */
116 + if (v >= 1020300)
117 +- exit(0);
118 ++ return 0;
119 +
120 +- exit(2);
121 ++ return 2;
122 + ]])],
123 + AC_MSG_RESULT([no]),
124 + [ AC_MSG_RESULT([yes])
125 +@@ -1254,7 +1254,7 @@
126 + #include <dirent.h>]],
127 + [[
128 + struct dirent d;
129 +- exit(sizeof(d.d_name)<=sizeof(char));
130 ++ return (sizeof(d.d_name)<=sizeof(char));
131 + ]])],
132 + [AC_MSG_RESULT([yes])],
133 + [
134 +@@ -1300,7 +1300,7 @@
135 + #include <skey.h>
136 + ]], [[
137 + char *ff = skey_keyinfo(""); ff="";
138 +- exit(0);
139 ++ return 0;
140 + ]])],
141 + [AC_MSG_RESULT([yes])],
142 + [
143 +@@ -1405,7 +1405,7 @@
144 + #include <stdlib.h>
145 + #include <stdint.h>
146 + #include <ldns/ldns.h>
147 +-int main() { ldns_status status = ldns_verify_trusted(NULL, NULL, NULL, NULL); status=LDNS_STATUS_OK; exit(0); }
148 ++int main() { ldns_status status = ldns_verify_trusted(NULL, NULL, NULL, NULL); status=LDNS_STATUS_OK; return 0; }
149 + ]])
150 + ],
151 + [AC_MSG_RESULT(yes)],
152 +@@ -1462,7 +1462,7 @@
153 + [[
154 + int i = H_SETSIZE;
155 + el_init("", NULL, NULL, NULL);
156 +- exit(0);
157 ++ return 0;
158 + ]])],
159 + [ AC_MSG_RESULT([yes]) ],
160 + [ AC_MSG_RESULT([no])
161 +@@ -1757,9 +1757,9 @@
162 + errno=0;
163 + setresuid(0,0,0);
164 + if (errno==ENOSYS)
165 +- exit(1);
166 ++ return 1;
167 + else
168 +- exit(0);
169 ++ return 0;
170 + ]])],
171 + [AC_MSG_RESULT([yes])],
172 + [AC_DEFINE([BROKEN_SETRESUID], [1],
173 +@@ -1780,9 +1780,9 @@
174 + errno=0;
175 + setresgid(0,0,0);
176 + if (errno==ENOSYS)
177 +- exit(1);
178 ++ return 1;
179 + else
180 +- exit(0);
181 ++ return 0;
182 + ]])],
183 + [AC_MSG_RESULT([yes])],
184 + [AC_DEFINE([BROKEN_SETRESGID], [1],
185 +@@ -1824,7 +1824,7 @@
186 + [[
187 + char b[5];
188 + snprintf(b,5,"123456789");
189 +- exit(b[4]!='\0');
190 ++ return (b[4]!='\0');
191 + ]])],
192 + [AC_MSG_RESULT([yes])],
193 + [
194 +@@ -1857,7 +1857,7 @@
195 + }
196 + ]], [[
197 + char x[1];
198 +- exit(x_snprintf(x, 1, "%s %d", "hello", 12345) == 11 ? 0 : 1);
199 ++ return (x_snprintf(x, 1, "%s %d", "hello", 12345) == 11 ? 0 : 1);
200 + ]])],
201 + [AC_MSG_RESULT([yes])],
202 + [
203 +@@ -1909,9 +1909,9 @@
204 + ]], [[
205 + char template[]="conftest.mkstemp-test";
206 + if (mkstemp(template) == -1)
207 +- exit(1);
208 ++ return 1;
209 + unlink(template);
210 +- exit(0);
211 ++ return 0;
212 + ]])],
213 + [
214 + AC_MSG_RESULT([no])
215 +@@ -1942,22 +1942,22 @@
216 +
217 + pid = fork();
218 + if (pid < 0) { /* failed */
219 +- exit(1);
220 ++ return 1;
221 + } else if (pid > 0) { /* parent */
222 + waitpid(pid, &status, 0);
223 + if (WIFEXITED(status))
224 +- exit(WEXITSTATUS(status));
225 ++ return (WEXITSTATUS(status));
226 + else
227 +- exit(2);
228 ++ return 2;
229 + } else { /* child */
230 + close(0); close(1); close(2);
231 + setsid();
232 + openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
233 + fd = open("/dev/tty", O_RDWR | O_NOCTTY);
234 + if (fd >= 0)
235 +- exit(3); /* Acquired ctty: broken */
236 ++ return 3; /* Acquired ctty: broken */
237 + else
238 +- exit(0); /* Did not acquire ctty: OK */
239 ++ return 0; /* Did not acquire ctty: OK */
240 + }
241 + ]])],
242 + [
243 +@@ -1998,7 +1998,7 @@
244 + err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
245 + if (err != 0) {
246 + fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
247 +- exit(1);
248 ++ return 1;
249 + }
250 +
251 + for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
252 +@@ -2015,7 +2015,7 @@
253 + else
254 + fprintf(stderr, "getnameinfo failed: %s\n",
255 + gai_strerror(err));
256 +- exit(2);
257 ++ return 2;
258 + }
259 +
260 + sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
261 +@@ -2023,10 +2023,10 @@
262 + perror("socket");
263 + if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
264 + if (errno == EBADF)
265 +- exit(3);
266 ++ return 3;
267 + }
268 + }
269 +- exit(0);
270 ++ return 0;
271 + ]])],
272 + [
273 + AC_MSG_RESULT([yes])
274 +@@ -2066,7 +2066,7 @@
275 + err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
276 + if (err != 0) {
277 + fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
278 +- exit(1);
279 ++ return 1;
280 + }
281 +
282 + for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
283 +@@ -2079,10 +2079,10 @@
284 +
285 + if (ai->ai_family == AF_INET && err != 0) {
286 + perror("getnameinfo");
287 +- exit(2);
288 ++ return 2;
289 + }
290 + }
291 +- exit(0);
292 ++ return 0;
293 + ]])],
294 + [
295 + AC_MSG_RESULT([yes])
296 +@@ -2103,7 +2103,7 @@
297 + if test "x$check_for_conflicting_getspnam" = "x1"; then
298 + AC_MSG_CHECKING([for conflicting getspnam in shadow.h])
299 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <shadow.h> ]],
300 +- [[ exit(0); ]])],
301 ++ [[ return 0; ]])],
302 + [
303 + AC_MSG_RESULT([no])
304 + ],
305 +@@ -2191,12 +2191,12 @@
306 +
307 + fd = fopen(DATA,"w");
308 + if(fd == NULL)
309 +- exit(1);
310 ++ return 1;
311 +
312 + if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
313 +- exit(1);
314 ++ return 1;
315 +
316 +- exit(0);
317 ++ return 0;
318 + ]])],
319 + [
320 + ssl_header_ver=`cat conftest.sslincver`
321 +@@ -2226,12 +2226,12 @@
322 +
323 + fd = fopen(DATA,"w");
324 + if(fd == NULL)
325 +- exit(1);
326 ++ return 1;
327 +
328 + if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
329 +- exit(1);
330 ++ return 1;
331 +
332 +- exit(0);
333 ++ return 0;
334 + ]])],
335 + [
336 + ssl_library_ver=`cat conftest.ssllibver`
337 +@@ -2261,7 +2261,7 @@
338 + #include <string.h>
339 + #include <openssl/opensslv.h>
340 + ]], [[
341 +- exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1);
342 ++ return (SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1);
343 + ]])],
344 + [
345 + AC_MSG_RESULT([yes])
346 +@@ -2339,7 +2339,7 @@
347 + #include <string.h>
348 + #include <openssl/evp.h>
349 + ]], [[
350 +- exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL);
351 ++ return (EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL);
352 + ]])],
353 + [
354 + AC_MSG_RESULT([no])
355 +@@ -2358,7 +2358,7 @@
356 + #include <string.h>
357 + #include <openssl/evp.h>
358 + ]], [[
359 +- exit(EVP_aes_128_ctr() == NULL ||
360 ++ return (EVP_aes_128_ctr() == NULL ||
361 + EVP_aes_192_cbc() == NULL ||
362 + EVP_aes_256_cbc() == NULL);
363 + ]])],
364 +@@ -2379,7 +2379,7 @@
365 + #include <string.h>
366 + #include <openssl/evp.h>
367 + ]], [[
368 +- exit(EVP_aes_128_gcm() == NULL ||
369 ++ return (EVP_aes_128_gcm() == NULL ||
370 + EVP_aes_256_gcm() == NULL ||
371 + EVP_CTRL_GCM_SET_IV_FIXED == 0 ||
372 + EVP_CTRL_GCM_IV_GEN == 0 ||
373 +@@ -2410,7 +2410,7 @@
374 + #include <openssl/evp.h>
375 + ]], [[
376 + if(EVP_DigestUpdate(NULL, NULL,0))
377 +- exit(0);
378 ++ return 0;
379 + ]])],
380 + [
381 + AC_MSG_RESULT([yes])
382 +@@ -2505,7 +2505,7 @@
383 + #include <string.h>
384 + #include <openssl/rand.h>
385 + ]], [[
386 +- exit(RAND_status() == 1 ? 0 : 1);
387 ++ return (RAND_status() == 1 ? 0 : 1);
388 + ]])],
389 + [
390 + OPENSSL_SEEDS_ITSELF=yes
391 +@@ -2702,7 +2702,7 @@
392 + [[ int i = $seccomp_audit_arch;
393 + errno = 0;
394 + prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0);
395 +- exit(errno == EFAULT ? 0 : 1); ]])],
396 ++ return (errno == EFAULT ? 0 : 1); ]])],
397 + [ AC_MSG_RESULT([yes]) ], [
398 + AC_MSG_RESULT([no])
399 + # Disable seccomp filter as a target
400 +@@ -2756,7 +2756,7 @@
401 + tv.tv_sec = 1;
402 + tv.tv_usec = 0;
403 + r = select(fd+1, &fds, NULL, NULL, &tv);
404 +- exit (r == -1 ? 1 : 0);
405 ++ return (r == -1 ? 1 : 0);
406 + ]])],
407 + [AC_MSG_RESULT([yes])
408 + select_works_with_rlimit=yes],
409 +@@ -2782,7 +2782,7 @@
410 +
411 + rl_zero.rlim_cur = rl_zero.rlim_max = 0;
412 + r = setrlimit(RLIMIT_NOFILE, &rl_zero);
413 +- exit (r == -1 ? 1 : 0);
414 ++ return (r == -1 ? 1 : 0);
415 + ]])],
416 + [AC_MSG_RESULT([yes])
417 + rlimit_nofile_zero_works=yes],
418 +@@ -2801,7 +2801,7 @@
419 + struct rlimit rl_zero;
420 +
421 + rl_zero.rlim_cur = rl_zero.rlim_max = 0;
422 +- exit(setrlimit(RLIMIT_FSIZE, &rl_zero) != 0);
423 ++ return (setrlimit(RLIMIT_FSIZE, &rl_zero) != 0);
424 + ]])],
425 + [AC_MSG_RESULT([yes])],
426 + [AC_MSG_RESULT([no])
427 +@@ -2925,7 +2925,7 @@
428 + long long i, llmin, llmax = 0;
429 +
430 + if((f = fopen(DATA,"w")) == NULL)
431 +- exit(1);
432 ++ return 1;
433 +
434 + #if defined(LLONG_MIN) && defined(LLONG_MAX)
435 + fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n");
436 +@@ -2944,16 +2944,16 @@
437 + || llmax - 1 > llmax || llmin == llmax || llmin == 0
438 + || llmax == 0 || llmax < LONG_MAX || llmin > LONG_MIN) {
439 + fprintf(f, "unknown unknown\n");
440 +- exit(2);
441 ++ return 2;
442 + }
443 +
444 + if (fprint_ll(f, llmin) < 0)
445 +- exit(3);
446 ++ return 3;
447 + if (fprint_ll(f, llmax) < 0)
448 +- exit(4);
449 ++ return 4;
450 + if (fclose(f) < 0)
451 +- exit(5);
452 +- exit(0);
453 ++ return 5;
454 ++ return 0;
455 + ]])],
456 + [
457 + llong_min=`$AWK '{print $1}' conftest.llminmax`
458 +@@ -3337,11 +3337,11 @@
459 + strcpy(expected_out, "9223372036854775807");
460 + snprintf(buf, mazsize, "%lld", num);
461 + if(strcmp(buf, expected_out) != 0)
462 +- exit(1);
463 +- exit(0);
464 ++ return 1;
465 ++ return 0;
466 + }
467 + #else
468 +-main() { exit(0); }
469 ++main() { return 0; }
470 + #endif
471 + ]])], [ true ], [ AC_DEFINE([BROKEN_SNPRINTF]) ],
472 + AC_MSG_WARN([cross compiling: Assuming working snprintf()])
473 +@@ -3425,11 +3425,11 @@
474 + ]], [[
475 + #ifdef msg_accrights
476 + #error "msg_accrights is a macro"
477 +-exit(1);
478 ++return 1;
479 + #endif
480 + struct msghdr m;
481 + m.msg_accrights = 0;
482 +-exit(0);
483 ++return 0;
484 + ]])],
485 + [ ac_cv_have_accrights_in_msghdr="yes" ],
486 + [ ac_cv_have_accrights_in_msghdr="no" ]
487 +@@ -3486,11 +3486,11 @@
488 + ]], [[
489 + #ifdef msg_control
490 + #error "msg_control is a macro"
491 +-exit(1);
492 ++return 1;
493 + #endif
494 + struct msghdr m;
495 + m.msg_control = 0;
496 +-exit(0);
497 ++return 0;
498 + ]])],
499 + [ ac_cv_have_control_in_msghdr="yes" ],
500 + [ ac_cv_have_control_in_msghdr="no" ]
501 +@@ -3912,22 +3912,22 @@
502 +
503 + fd = fopen(DATA,"w");
504 + if(fd == NULL)
505 +- exit(1);
506 ++ return 1;
507 +
508 + #if defined (_PATH_MAILDIR)
509 + if ((rc = fprintf(fd ,"_PATH_MAILDIR:%s\n", _PATH_MAILDIR)) <0)
510 +- exit(1);
511 ++ return 1;
512 + #elif defined (MAILDIR)
513 + if ((rc = fprintf(fd ,"MAILDIR:%s\n", MAILDIR)) <0)
514 +- exit(1);
515 ++ return 1;
516 + #elif defined (_PATH_MAIL)
517 + if ((rc = fprintf(fd ,"_PATH_MAIL:%s\n", _PATH_MAIL)) <0)
518 +- exit(1);
519 ++ return 1;
520 + #else
521 +- exit (2);
522 ++ return 2;
523 + #endif
524 +
525 +- exit(0);
526 ++ return 0;
527 + ]])],
528 + [
529 + maildir_what=`awk -F: '{print $1}' conftest.maildir`
530 +@@ -4162,12 +4162,12 @@
531 +
532 + fd = fopen(DATA,"w");
533 + if(fd == NULL)
534 +- exit(1);
535 ++ return 1;
536 +
537 + if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
538 +- exit(1);
539 ++ return 1;
540 +
541 +- exit(0);
542 ++ return 0;
543 + ]])],
544 + [ user_path=`cat conftest.stdpath` ],
545 + [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
546
547 diff --git a/net-misc/openssh/files/openssh-6.4p1-fix-typo-construct_utmpx.patch b/net-misc/openssh/files/openssh-6.4p1-fix-typo-construct_utmpx.patch
548 new file mode 100644
549 index 0000000..a3361ca
550 --- /dev/null
551 +++ b/net-misc/openssh/files/openssh-6.4p1-fix-typo-construct_utmpx.patch
552 @@ -0,0 +1,21 @@
553 +diff -Naur openssh-6.4p1.orig/loginrec.c openssh-6.4p1/loginrec.c
554 +--- openssh-6.4p1.orig/loginrec.c 2014-01-22 17:33:12.380676129 +0000
555 ++++ openssh-6.4p1/loginrec.c 2014-01-22 17:55:40.957751536 +0000
556 +@@ -785,12 +785,12 @@
557 + /* this is just a 128-bit IPv6 address */
558 + if (li->hostaddr.sa.sa_family == AF_INET6) {
559 + sa6 = ((struct sockaddr_in6 *)&li->hostaddr.sa);
560 +- memcpy(ut->ut_addr_v6, sa6->sin6_addr.s6_addr, 16);
561 ++ memcpy(utx->ut_addr_v6, sa6->sin6_addr.s6_addr, 16);
562 + if (IN6_IS_ADDR_V4MAPPED(&sa6->sin6_addr)) {
563 +- ut->ut_addr_v6[0] = ut->ut_addr_v6[3];
564 +- ut->ut_addr_v6[1] = 0;
565 +- ut->ut_addr_v6[2] = 0;
566 +- ut->ut_addr_v6[3] = 0;
567 ++ utx->ut_addr_v6[0] = utx->ut_addr_v6[3];
568 ++ utx->ut_addr_v6[1] = 0;
569 ++ utx->ut_addr_v6[2] = 0;
570 ++ utx->ut_addr_v6[3] = 0;
571 + }
572 + }
573 + # endif
574
575 diff --git a/net-misc/openssh/files/openssh-6.4p1-missing-sys_param_h.patch b/net-misc/openssh/files/openssh-6.4p1-missing-sys_param_h.patch
576 new file mode 100644
577 index 0000000..22b6ffa
578 --- /dev/null
579 +++ b/net-misc/openssh/files/openssh-6.4p1-missing-sys_param_h.patch
580 @@ -0,0 +1,67 @@
581 +diff -Naur openssh-6.4p1.orig/channels.c openssh-6.4p1/channels.c
582 +--- openssh-6.4p1.orig/channels.c 2014-01-22 17:14:19.508612783 +0000
583 ++++ openssh-6.4p1/channels.c 2014-01-22 17:18:18.176626129 +0000
584 +@@ -61,6 +61,7 @@
585 + #include <termios.h>
586 + #include <unistd.h>
587 + #include <stdarg.h>
588 ++#include <sys/param.h>
589 +
590 + #include "openbsd-compat/sys-queue.h"
591 + #include "xmalloc.h"
592 +diff -Naur openssh-6.4p1.orig/loginrec.c openssh-6.4p1/loginrec.c
593 +--- openssh-6.4p1.orig/loginrec.c 2013-06-01 22:07:32.000000000 +0000
594 ++++ openssh-6.4p1/loginrec.c 2014-01-22 17:30:57.322668577 +0000
595 +@@ -162,6 +162,7 @@
596 + #include <stdarg.h>
597 + #include <string.h>
598 + #include <time.h>
599 ++#include <sys/time.h>
600 + #include <unistd.h>
601 +
602 + #include "xmalloc.h"
603 +diff -Naur openssh-6.4p1.orig/sshconnect.c openssh-6.4p1/sshconnect.c
604 +--- openssh-6.4p1.orig/sshconnect.c 2014-01-22 17:16:53.809621411 +0000
605 ++++ openssh-6.4p1/sshconnect.c 2014-01-22 17:17:19.535622850 +0000
606 +@@ -40,6 +40,7 @@
607 + #include <stdlib.h>
608 + #include <string.h>
609 + #include <unistd.h>
610 ++#include <sys/param.h>
611 +
612 + #include "xmalloc.h"
613 + #include "key.h"
614 +diff -Naur openssh-6.4p1.orig/sshd.c openssh-6.4p1/sshd.c
615 +--- openssh-6.4p1.orig/sshd.c 2014-01-22 17:14:19.517612784 +0000
616 ++++ openssh-6.4p1/sshd.c 2014-01-22 17:18:54.560628163 +0000
617 +@@ -83,6 +83,8 @@
618 + #include <prot.h>
619 + #endif
620 +
621 ++#include <sys/param.h>
622 ++
623 + #include "xmalloc.h"
624 + #include "ssh.h"
625 + #include "ssh1.h"
626 +diff -Naur openssh-6.4p1.orig/ssh-keyscan.c openssh-6.4p1/ssh-keyscan.c
627 +--- openssh-6.4p1.orig/ssh-keyscan.c 2013-06-01 21:31:19.000000000 +0000
628 ++++ openssh-6.4p1/ssh-keyscan.c 2014-01-22 17:59:37.756764777 +0000
629 +@@ -29,6 +29,7 @@
630 + #include <signal.h>
631 + #include <string.h>
632 + #include <unistd.h>
633 ++#include <sys/param.h>
634 +
635 + #include "xmalloc.h"
636 + #include "ssh.h"
637 +diff -Naur openssh-6.4p1.orig/ssh-pkcs11-helper.c openssh-6.4p1/ssh-pkcs11-helper.c
638 +--- openssh-6.4p1.orig/ssh-pkcs11-helper.c 2013-06-01 21:31:19.000000000 +0000
639 ++++ openssh-6.4p1/ssh-pkcs11-helper.c 2014-01-22 18:00:04.653766281 +0000
640 +@@ -28,6 +28,7 @@
641 + #include <string.h>
642 + #include <unistd.h>
643 + #include <errno.h>
644 ++#include <sys/param.h>
645 +
646 + #include "xmalloc.h"
647 + #include "buffer.h"
648
649 diff --git a/net-misc/openssh/openssh-6.4_p1-r99.ebuild b/net-misc/openssh/openssh-6.4_p1-r99.ebuild
650 index a2467d1..aafd19d 100644
651 --- a/net-misc/openssh/openssh-6.4_p1-r99.ebuild
652 +++ b/net-misc/openssh/openssh-6.4_p1-r99.ebuild
653 @@ -131,6 +131,10 @@ src_prepare() {
654 )
655 sed -i "${sed_args[@]}" configure{,.ac} || die
656
657 + epatch "${FILESDIR}"/${PN}-6.4p1-avoid-exit.patch
658 + epatch "${FILESDIR}"/${PN}-6.4p1-missing-sys_param_h.patch
659 + epatch "${FILESDIR}"/${PN}-6.4p1-fix-typo-construct_utmpx.patch
660 +
661 epatch_user #473004
662
663 # Now we can build a sane merged version.h