commit:     4de76a2e5a9e0687802b69749c195c7ecd463dd2
Author:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 13 18:50:34 2018 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Tue Mar 13 18:50:34 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4de76a2e

net-misc/openssh: Add glue patch for X509 + permitopen in 7.6_p1-r5

Package-Manager: Portage-2.3.24, Repoman-2.3.6

 .../openssh-7.6_p1-permitopen-x509-glue.patch      | 44 ++++++++++++++++++++++
 net-misc/openssh/openssh-7.6_p1-r5.ebuild          |  5 +++
 2 files changed, 49 insertions(+)

diff --git a/net-misc/openssh/files/openssh-7.6_p1-permitopen-x509-glue.patch 
b/net-misc/openssh/files/openssh-7.6_p1-permitopen-x509-glue.patch
new file mode 100644
index 00000000000..9d8f9a6cdef
--- /dev/null
+++ b/net-misc/openssh/files/openssh-7.6_p1-permitopen-x509-glue.patch
@@ -0,0 +1,44 @@
+--- a/openssh-7.6p1+x509-11.2.diff     2018-03-13 10:48:08.755434051 -0700
++++ b/openssh-7.6p1+x509-11.2.diff     2018-03-13 10:51:27.217980071 -0700
+@@ -29025,13 +29025,6 @@
+ diff -ruN openssh-7.6p1/servconf.c openssh-7.6p1+x509-11.2/servconf.c
+ --- openssh-7.6p1/servconf.c  2017-10-02 22:34:26.000000000 +0300
+ +++ openssh-7.6p1+x509-11.2/servconf.c        2018-02-11 12:07:01.000000000 
+0200
+-@@ -1,5 +1,5 @@
+- 
+--/* $OpenBSD: servconf.c,v 1.312 2017/10/02 19:33:20 djm Exp $ */
+-+/* $OpenBSD: servconf.c,v 1.313 2017/10/04 18:49:30 djm Exp $ */
+- /*
+-  * Copyright (c) 1995 Tatu Ylonen <y...@cs.hut.fi>, Espoo, Finland
+-  *                    All rights reserved
+ @@ -9,6 +9,29 @@
+   * software must be clearly marked as such, and if the derived work is
+   * incompatible with the protocol description in the RFC file, it must be
+@@ -29467,27 +29460,6 @@
+       case sAllowUsers:
+               while ((arg = strdelim(&cp)) && *arg != '\0') {
+                       if (options->num_allow_users >= MAX_ALLOW_USERS)
+-@@ -1663,9 +1931,9 @@
+-              if (!arg || *arg == '\0')
+-                      fatal("%s line %d: missing PermitOpen specification",
+-                          filename, linenum);
+--             i = options->num_permitted_opens;       /* modified later */
+-+             value = options->num_permitted_opens;   /* modified later */
+-              if (strcmp(arg, "any") == 0 || strcmp(arg, "none") == 0) {
+--                     if (*activep && i == 0) {
+-+                     if (*activep && value == 0) {
+-                              options->num_permitted_opens = 1;
+-                              options->permitted_opens = xcalloc(1,
+-                                  sizeof(*options->permitted_opens));
+-@@ -1683,7 +1951,7 @@
+-                      if (arg == NULL || ((port = permitopen_port(arg)) < 0))
+-                              fatal("%s line %d: bad port number in "
+-                                  "PermitOpen", filename, linenum);
+--                     if (*activep && i == 0) {
+-+                     if (*activep && value == 0) {
+-                              options->permitted_opens = xrecallocarray(
+-                                  options->permitted_opens,
+-                                  options->num_permitted_opens,
+ @@ -1885,11 +2153,20 @@
+  
+       case sDeprecated:

diff --git a/net-misc/openssh/openssh-7.6_p1-r5.ebuild 
b/net-misc/openssh/openssh-7.6_p1-r5.ebuild
index e19d5f0f30b..46f1d676f5f 100644
--- a/net-misc/openssh/openssh-7.6_p1-r5.ebuild
+++ b/net-misc/openssh/openssh-7.6_p1-r5.ebuild
@@ -122,6 +122,11 @@ src_prepare() {
                        popd >/dev/null
                        save_version X509
                fi
+               # remove this with the next version bump
+               pushd "${WORKDIR}" >/dev/null
+               eapply "${FILESDIR}/${P}-permitopen-x509-glue.patch"
+               popd >/dev/null
+
                eapply "${WORKDIR}"/${X509_PATCH%.*}
        fi
 

Reply via email to