Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/openssh/
Date: Mon, 11 Jun 2018 22:47:13
Message-Id: 1528757219.7d7ff6f0c26e07ab5dcf45b5bdd5f2fb8b67cfc7.whissi@gentoo
1 commit: 7d7ff6f0c26e07ab5dcf45b5bdd5f2fb8b67cfc7
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jun 11 22:45:47 2018 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Mon Jun 11 22:46:59 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d7ff6f0
7
8 net-misc/openssh: drop old
9
10 Package-Manager: Portage-2.3.40, Repoman-2.3.9
11
12 net-misc/openssh/Manifest | 2 -
13 net-misc/openssh/openssh-7.6_p1-r4.ebuild | 336 -----------------------
14 net-misc/openssh/openssh-7.7_p1-r1.ebuild | 414 -----------------------------
15 net-misc/openssh/openssh-7.7_p1-r2.ebuild | 426 -----------------------------
16 net-misc/openssh/openssh-7.7_p1-r3.ebuild | 427 ------------------------------
17 5 files changed, 1605 deletions(-)
18
19 diff --git a/net-misc/openssh/Manifest b/net-misc/openssh/Manifest
20 index 16fa1505ca1..b0fcdb7976a 100644
21 --- a/net-misc/openssh/Manifest
22 +++ b/net-misc/openssh/Manifest
23 @@ -6,9 +6,7 @@ DIST openssh-7.6_p1-sctp.patch.xz 6996 BLAKE2B 4a857afdc8fa5cb2bfb9dd1805ac6343e
24 DIST openssh-7.6p1+x509-11.2.diff.gz 466657 BLAKE2B 3f4f108e2d97eb292c215bc3a6e2c64ae6b9e49704f46f46a21496a71d5ebd051ab648446bf71ef141e2114f4a03363d8cd043f5813f957c2c5f2e2eb193931d SHA512 1c0fea91037bfcaed7aa3f0cb01d262410a99d3e1b98a25a012db5d683f3275ab52f78f1e446bd7e543c78f9d406b1dce2bb3997214534ae94e11c254658080f
25 DIST openssh-7.6p1-hpnssh14v12-r1.tar.xz 15440 BLAKE2B e140852a3ce63e4f744ed4b18b474cf88d09ca55509e5a16d26eef5cf8574466b472073eef56e19467932959d9ba7e941ab561d9ea0704dfee3fd08a6ba7ba8c SHA512 9d0450ec99fe550d790e471cb7815d0863788cf9c41dfef653d102f02be3d38a09e5103e537658279216a5815c1a075ded9f011e05ce216beee2c7daeea8c75a
26 DIST openssh-7.6p1.tar.gz 1489788 BLAKE2B 938bfeeff0a0aaa2fc7e4c345f04561c6c071c526e354a7d344a08742cb70ab1f4a41d325b31720f2fba5c4afa4db11f3fc87055c8c9c8bea37b29cc11dc8f39 SHA512 de17fdcb8239401f76740c8d689a8761802f6df94e68d953f3c70b9f4f8bdb403617c48c1d01cc8c368d88e9d50aee540bf03d5a36687dfb39dfd28d73029d72
27 -DIST openssh-7.7p1-hpnssh14v14-gentoo1.patch.xz 21448 BLAKE2B 51d9324990d8098707359f355b9212679db38569e566f47659ffdae8046bdbb4e6873bd67ecb7da0b5706c5243f44f82089f08ecbc59c7e39062fceb4be78316 SHA512 63d2ffbcfe121ddedaa07955b1025d2c6e196ea694464610437368835cf46dd507d4d17361548cae93db53a1e3d93d9c409910620bbd0cd619d82b6215c833b5
28 DIST openssh-7.7p1-hpnssh14v15-gentoo1.patch.xz 22060 BLAKE2B 81a7f3d1346718c154b39920c126eb0b00ae43f1369d882b8a1bd0b885668805639d869581fb49a8e7c67b61d72a904fde45841e4396af426b136d6d2f0a0dc3 SHA512 7b437bc061677aeabe561ad74bb19bc6f85369119ad8a92fb430fb5c1394c2bb3afd472ee66b285362b2041f871c56633dc94fec33cb062c6b1817d63c1d4a78
29 -DIST openssh-7.7p1-patches-1.0.tar.xz 8176 BLAKE2B 196b756f72bb3fccc927e31ae1b94adc3c9116de25258ac599c3653cd1234ff33f3dc608515a5ef56bea05191621974342bdb164b721c94d2c29a0de74731742 SHA512 9d56e306a5886a19d58c7a42389a82d8b912bb9250f97f64e9bf9752fc92e671539b24b0568f21072fb1ba7185e6bd1ec33511a39d26d48a699a911b910121c9
30 DIST openssh-7.7p1-patches-1.1.tar.xz 16476 BLAKE2B fca2885a9e29faec40700ece37a995ba83e40bd2a6875129a5327770d8ee43663a7c063de33b4653994ed7332adb03730f613c047550d874190b95c66e2e9efa SHA512 aa5e33ce4bb4be16abf27ac1bade1dc85c51d82002be546402e0b8b0685de3ec7029f0f56bf1295ec346eb3960a6bed7cfc882722e57957a19a732f3174b3039
31 DIST openssh-7.7p1-sctp-1.0.patch.xz 7380 BLAKE2B 6ad40972ece131ff148ede6ba94d63bffc606e0bcabb959d4c9056196cb6f4fddc285f97d7b49b73fde7ee84e3c981c07bddb058ad88eb7c7c2fe716e657c630 SHA512 bc5f50805ba25415f93f61b6654e5bcbaef673b0af48d339116ca9c94b6152afae294c5a9144adeb40190da97c2fc73b43e3ac7ac34feb4a647628327a7cac0a
32 DIST openssh-7.7p1-x509-11.3.1.patch.xz 362672 BLAKE2B 55b8b0ef00dc4d962a0db1115406b7b1e84110870c74198e9e4cb081b2ffde8daca67cb281c69d73b4c5cbffde361429d62634be194b57e888a0b434a0f42a37 SHA512 f84744f6d2e5a15017bce37bfa65ebb47dbafeac07ea9aab46bdc780b4062ff70687512d9d512cab81e3b9c701adb6ce17c5474f35cb4b49f57db2e2d45ac9ac
33
34 diff --git a/net-misc/openssh/openssh-7.6_p1-r4.ebuild b/net-misc/openssh/openssh-7.6_p1-r4.ebuild
35 deleted file mode 100644
36 index 68ad3c2a252..00000000000
37 --- a/net-misc/openssh/openssh-7.6_p1-r4.ebuild
38 +++ /dev/null
39 @@ -1,336 +0,0 @@
40 -# Copyright 1999-2018 Gentoo Foundation
41 -# Distributed under the terms of the GNU General Public License v2
42 -
43 -EAPI=6
44 -
45 -inherit user flag-o-matic multilib autotools pam systemd versionator
46 -
47 -# Make it more portable between straight releases
48 -# and _p? releases.
49 -PARCH=${P/_}
50 -
51 -HPN_PATCH="${PARCH}-hpnssh14v12-r1.tar.xz"
52 -SCTP_PATCH="${PN}-7.6_p1-sctp.patch.xz"
53 -LDAP_PATCH="${PN}-lpk-7.6p1-0.3.14.patch.xz"
54 -X509_VER="11.2" X509_PATCH="${PN}-${PV/_}+x509-${X509_VER}.diff.gz"
55 -
56 -DESCRIPTION="Port of OpenBSD's free SSH release"
57 -HOMEPAGE="http://www.openssh.org/"
58 -SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
59 - ${SCTP_PATCH:+https://dev.gentoo.org/~polynomial-c/${SCTP_PATCH}}
60 - ${HPN_PATCH:+hpn? ( https://dev.gentoo.org/~chutzpah/${HPN_PATCH} )}
61 - ${LDAP_PATCH:+ldap? ( https://dev.gentoo.org/~polynomial-c/${LDAP_PATCH} )}
62 - ${X509_PATCH:+X509? ( https://dev.gentoo.org/~chutzpah/${X509_PATCH} )}
63 - "
64 -
65 -LICENSE="BSD GPL-2"
66 -SLOT="0"
67 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
68 -# Probably want to drop ssl defaulting to on in a future version.
69 -IUSE="abi_mips_n32 audit bindist debug hpn kerberos kernel_linux ldap ldns libedit libressl livecd pam +pie sctp selinux skey +ssl static test X X509"
70 -REQUIRED_USE="ldns? ( ssl )
71 - pie? ( !static )
72 - static? ( !kerberos !pam )
73 - X509? ( !ldap !sctp ssl )
74 - test? ( ssl )"
75 -
76 -LIB_DEPEND="
77 - audit? ( sys-process/audit[static-libs(+)] )
78 - ldns? (
79 - net-libs/ldns[static-libs(+)]
80 - !bindist? ( net-libs/ldns[ecdsa,ssl(+)] )
81 - bindist? ( net-libs/ldns[-ecdsa,ssl(+)] )
82 - )
83 - libedit? ( dev-libs/libedit:=[static-libs(+)] )
84 - sctp? ( net-misc/lksctp-tools[static-libs(+)] )
85 - selinux? ( >=sys-libs/libselinux-1.28[static-libs(+)] )
86 - skey? ( >=sys-auth/skey-1.1.5-r1[static-libs(+)] )
87 - ssl? (
88 - !libressl? (
89 - >=dev-libs/openssl-1.0.1:0=[bindist=]
90 - dev-libs/openssl:0=[static-libs(+)]
91 - )
92 - libressl? ( dev-libs/libressl:0=[static-libs(+)] )
93 - )
94 - >=sys-libs/zlib-1.2.3:=[static-libs(+)]"
95 -RDEPEND="
96 - !static? ( ${LIB_DEPEND//\[static-libs(+)]} )
97 - pam? ( virtual/pam )
98 - kerberos? ( virtual/krb5 )
99 - ldap? ( net-nds/openldap )"
100 -DEPEND="${RDEPEND}
101 - static? ( ${LIB_DEPEND} )
102 - virtual/pkgconfig
103 - virtual/os-headers
104 - sys-devel/autoconf"
105 -RDEPEND="${RDEPEND}
106 - pam? ( >=sys-auth/pambase-20081028 )
107 - userland_GNU? ( virtual/shadow )
108 - X? ( x11-apps/xauth )"
109 -
110 -S="${WORKDIR}/${PARCH}"
111 -
112 -pkg_pretend() {
113 - # this sucks, but i'd rather have people unable to `emerge -u openssh`
114 - # than not be able to log in to their server any more
115 - maybe_fail() { [[ -z ${!2} ]] && echo "$1" ; }
116 - local fail="
117 - $(use X509 && maybe_fail X509 X509_PATCH)
118 - $(use ldap && maybe_fail ldap LDAP_PATCH)
119 - $(use hpn && maybe_fail hpn HPN_PATCH)
120 - "
121 - fail=$(echo ${fail})
122 - if [[ -n ${fail} ]] ; then
123 - eerror "Sorry, but this version does not yet support features"
124 - eerror "that you requested: ${fail}"
125 - eerror "Please mask ${PF} for now and check back later:"
126 - eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
127 - die "booooo"
128 - fi
129 -
130 - # Make sure people who are using tcp wrappers are notified of its removal. #531156
131 - if grep -qs '^ *sshd *:' "${EROOT}"/etc/hosts.{allow,deny} ; then
132 - ewarn "Sorry, but openssh no longer supports tcp-wrappers, and it seems like"
133 - ewarn "you're trying to use it. Update your ${EROOT}etc/hosts.{allow,deny} please."
134 - fi
135 -}
136 -
137 -save_version() {
138 - # version.h patch conflict avoidence
139 - mv version.h version.h.$1
140 - cp -f version.h.pristine version.h
141 -}
142 -
143 -src_prepare() {
144 - sed -i \
145 - -e "/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:${EPREFIX}/usr/bin/xauth:" \
146 - pathnames.h || die
147 - # keep this as we need it to avoid the conflict between LPK and HPN changing
148 - # this file.
149 - cp version.h version.h.pristine
150 -
151 - eapply "${FILESDIR}/${P}-warnings.patch"
152 - eapply "${FILESDIR}"/${PN}-7.5_p1-disable-conch-interop-tests.patch
153 -
154 - # don't break .ssh/authorized_keys2 for fun
155 - sed -i '/^AuthorizedKeysFile/s:^:#:' sshd_config || die
156 -
157 - if use X509 ; then
158 - if use hpn ; then
159 - pushd "${WORKDIR}" >/dev/null
160 - eapply "${FILESDIR}"/${P}-hpn-x509-${X509_VER}-glue.patch
161 - popd >/dev/null
162 - save_version X509
163 - fi
164 - eapply "${WORKDIR}"/${X509_PATCH%.*}
165 - fi
166 -
167 - if use ldap ; then
168 - eapply "${WORKDIR}"/${LDAP_PATCH%.*}
169 - save_version LPK
170 - fi
171 -
172 - eapply "${FILESDIR}"/${PN}-7.5_p1-GSSAPI-dns.patch #165444 integrated into gsskex
173 - eapply "${FILESDIR}"/${PN}-6.7_p1-openssl-ignore-status.patch
174 - use X509 || eapply "${WORKDIR}"/${SCTP_PATCH%.*}
175 - use abi_mips_n32 && eapply "${FILESDIR}"/${PN}-7.3-mips-seccomp-n32.patch
176 -
177 - if use hpn ; then
178 - elog "Applying HPN patchset ..."
179 - eapply "${WORKDIR}"/${HPN_PATCH%.*.*}
180 - save_version HPN
181 - fi
182 -
183 - tc-export PKG_CONFIG
184 - local sed_args=(
185 - -e "s:-lcrypto:$(${PKG_CONFIG} --libs openssl):"
186 - # Disable PATH reset, trust what portage gives us #254615
187 - -e 's:^PATH=/:#PATH=/:'
188 - # Disable fortify flags ... our gcc does this for us
189 - -e 's:-D_FORTIFY_SOURCE=2::'
190 - )
191 - # The -ftrapv flag ICEs on hppa #505182
192 - use hppa && sed_args+=(
193 - -e '/CFLAGS/s:-ftrapv:-fdisable-this-test:'
194 - -e '/OSSH_CHECK_CFLAG_LINK.*-ftrapv/d'
195 - )
196 - # _XOPEN_SOURCE causes header conflicts on Solaris
197 - [[ ${CHOST} == *-solaris* ]] && sed_args+=(
198 - -e 's/-D_XOPEN_SOURCE//'
199 - )
200 - sed -i "${sed_args[@]}" configure{.ac,} || die
201 -
202 - eapply_user #473004
203 -
204 - # Now we can build a sane merged version.h
205 - (
206 - sed '/^#define SSH_RELEASE/d' version.h.* | sort -u
207 - macros=()
208 - for p in HPN LPK X509; do [[ -e version.h.${p} ]] && macros+=( SSH_${p} ) ; done
209 - printf '#define SSH_RELEASE SSH_VERSION SSH_PORTABLE %s\n' "${macros[*]}"
210 - ) > version.h
211 -
212 - eautoreconf
213 -}
214 -
215 -src_configure() {
216 - addwrite /dev/ptmx
217 -
218 - use debug && append-cppflags -DSANDBOX_SECCOMP_FILTER_DEBUG
219 - use static && append-ldflags -static
220 -
221 - local myconf=(
222 - --with-ldflags="${LDFLAGS}"
223 - --disable-strip
224 - --with-pid-dir="${EPREFIX}"$(usex kernel_linux '' '/var')/run
225 - --sysconfdir="${EPREFIX}"/etc/ssh
226 - --libexecdir="${EPREFIX}"/usr/$(get_libdir)/misc
227 - --datadir="${EPREFIX}"/usr/share/openssh
228 - --with-privsep-path="${EPREFIX}"/var/empty
229 - --with-privsep-user=sshd
230 - $(use_with audit audit linux)
231 - $(use_with kerberos kerberos5 "${EPREFIX}"/usr)
232 - # We apply the ldap patch conditionally, so can't pass --without-ldap
233 - # unconditionally else we get unknown flag warnings.
234 - $(use ldap && use_with ldap)
235 - $(use_with ldns)
236 - $(use_with libedit)
237 - $(use_with pam)
238 - $(use_with pie)
239 - $(use X509 || use_with sctp)
240 - $(use_with selinux)
241 - $(use_with skey)
242 - $(use_with ssl openssl)
243 - $(use_with ssl md5-passwords)
244 - $(use_with ssl ssl-engine)
245 - )
246 -
247 - # The seccomp sandbox is broken on x32, so use the older method for now. #553748
248 - use amd64 && [[ ${ABI} == "x32" ]] && myconf+=( --with-sandbox=rlimit )
249 -
250 - econf "${myconf[@]}"
251 -}
252 -
253 -src_install() {
254 - emake install-nokeys DESTDIR="${D}"
255 - fperms 600 /etc/ssh/sshd_config
256 - dobin contrib/ssh-copy-id
257 - newinitd "${FILESDIR}"/sshd.rc6.4 sshd
258 - newconfd "${FILESDIR}"/sshd.confd sshd
259 -
260 - newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
261 - if use pam ; then
262 - sed -i \
263 - -e "/^#UsePAM /s:.*:UsePAM yes:" \
264 - -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
265 - -e "/^#PrintMotd /s:.*:PrintMotd no:" \
266 - -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
267 - "${ED}"/etc/ssh/sshd_config || die
268 - fi
269 -
270 - # Gentoo tweaks to default config files
271 - cat <<-EOF >> "${ED}"/etc/ssh/sshd_config
272 -
273 - # Allow client to pass locale environment variables #367017
274 - AcceptEnv LANG LC_*
275 - EOF
276 - cat <<-EOF >> "${ED}"/etc/ssh/ssh_config
277 -
278 - # Send locale environment variables #367017
279 - SendEnv LANG LC_*
280 - EOF
281 -
282 - if use livecd ; then
283 - sed -i \
284 - -e '/^#PermitRootLogin/c# Allow root login with password on livecds.\nPermitRootLogin Yes' \
285 - "${ED}"/etc/ssh/sshd_config || die
286 - fi
287 -
288 - if ! use X509 && [[ -n ${LDAP_PATCH} ]] && use ldap ; then
289 - insinto /etc/openldap/schema/
290 - newins openssh-lpk_openldap.schema openssh-lpk.schema
291 - fi
292 -
293 - doman contrib/ssh-copy-id.1
294 - dodoc CREDITS OVERVIEW README* TODO sshd_config
295 - use X509 || dodoc ChangeLog
296 -
297 - diropts -m 0700
298 - dodir /etc/skel/.ssh
299 -
300 - systemd_dounit "${FILESDIR}"/sshd.{service,socket}
301 - systemd_newunit "${FILESDIR}"/sshd_at.service 'sshd@.service'
302 -}
303 -
304 -src_test() {
305 - local t skipped=() failed=() passed=()
306 - local tests=( interop-tests compat-tests )
307 -
308 - local shell=$(egetshell "${UID}")
309 - if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
310 - elog "Running the full OpenSSH testsuite requires a usable shell for the 'portage'"
311 - elog "user, so we will run a subset only."
312 - skipped+=( tests )
313 - else
314 - tests+=( tests )
315 - fi
316 -
317 - # It will also attempt to write to the homedir .ssh.
318 - local sshhome=${T}/homedir
319 - mkdir -p "${sshhome}"/.ssh
320 - for t in "${tests[@]}" ; do
321 - # Some tests read from stdin ...
322 - HOMEDIR="${sshhome}" HOME="${sshhome}" \
323 - emake -k -j1 ${t} </dev/null \
324 - && passed+=( "${t}" ) \
325 - || failed+=( "${t}" )
326 - done
327 -
328 - einfo "Passed tests: ${passed[*]}"
329 - [[ ${#skipped[@]} -gt 0 ]] && ewarn "Skipped tests: ${skipped[*]}"
330 - [[ ${#failed[@]} -gt 0 ]] && die "Some tests failed: ${failed[*]}"
331 -}
332 -
333 -pkg_preinst() {
334 - enewgroup sshd 22
335 - enewuser sshd 22 -1 /var/empty sshd
336 -}
337 -
338 -pkg_postinst() {
339 - if has_version "<${CATEGORY}/${PN}-5.8_p1" ; then
340 - elog "Starting with openssh-5.8p1, the server will default to a newer key"
341 - elog "algorithm (ECDSA). You are encouraged to manually update your stored"
342 - elog "keys list as servers update theirs. See ssh-keyscan(1) for more info."
343 - fi
344 - if has_version "<${CATEGORY}/${PN}-7.0_p1" ; then
345 - elog "Starting with openssh-6.7, support for USE=tcpd has been dropped by upstream."
346 - elog "Make sure to update any configs that you might have. Note that xinetd might"
347 - elog "be an alternative for you as it supports USE=tcpd."
348 - fi
349 - if has_version "<${CATEGORY}/${PN}-7.1_p1" ; then #557388 #555518
350 - elog "Starting with openssh-7.0, support for ssh-dss keys were disabled due to their"
351 - elog "weak sizes. If you rely on these key types, you can re-enable the key types by"
352 - elog "adding to your sshd_config or ~/.ssh/config files:"
353 - elog " PubkeyAcceptedKeyTypes=+ssh-dss"
354 - elog "You should however generate new keys using rsa or ed25519."
355 -
356 - elog "Starting with openssh-7.0, the default for PermitRootLogin changed from 'yes'"
357 - elog "to 'prohibit-password'. That means password auth for root users no longer works"
358 - elog "out of the box. If you need this, please update your sshd_config explicitly."
359 - fi
360 - if has_version "<${CATEGORY}/${PN}-7.6_p1" ; then
361 - elog "Starting with openssh-7.6p1, openssh upstream has removed ssh1 support entirely."
362 - elog "Furthermore, rsa keys with less than 1024 bits will be refused."
363 - fi
364 - if ! use ssl && has_version "${CATEGORY}/${PN}[ssl]" ; then
365 - elog "Be aware that by disabling openssl support in openssh, the server and clients"
366 - elog "no longer support dss/rsa/ecdsa keys. You will need to generate ed25519 keys"
367 - elog "and update all clients/servers that utilize them."
368 - fi
369 -
370 - # remove this if aes-ctr-mt gets fixed
371 - if use hpn; then
372 - elog "The multithreaded AES-CTR cipher has been temporarily dropped from the HPN patch"
373 - elog "set since it does not (yet) work with >=openssh-7.6p1."
374 - fi
375 -}
376
377 diff --git a/net-misc/openssh/openssh-7.7_p1-r1.ebuild b/net-misc/openssh/openssh-7.7_p1-r1.ebuild
378 deleted file mode 100644
379 index cfcfc30327f..00000000000
380 --- a/net-misc/openssh/openssh-7.7_p1-r1.ebuild
381 +++ /dev/null
382 @@ -1,414 +0,0 @@
383 -# Copyright 1999-2018 Gentoo Foundation
384 -# Distributed under the terms of the GNU General Public License v2
385 -
386 -EAPI=6
387 -
388 -inherit user flag-o-matic multilib autotools pam systemd versionator
389 -
390 -# Make it more portable between straight releases
391 -# and _p? releases.
392 -PARCH=${P/_}
393 -
394 -HPN_VER="14v14-gentoo1" HPN_PATCH="${PARCH}-hpnssh${HPN_VER}.patch.xz" HPN_DISABLE_MTAES=1
395 -SCTP_VER="1.0" SCTP_PATCH="${PARCH}-sctp-${SCTP_VER}.patch.xz"
396 -X509_VER="11.3.1" X509_PATCH="${PARCH}-x509-${X509_VER}.patch.xz"
397 -
398 -# Disable LDAP support until someone will rewrite the patch,
399 -# upstream removed auth_parse_options() via commit 7c856857607112a3dfe6414696bf4c7ab7fb0cb3
400 -#LDAP_VER="0.3.14" LDAP_PATCH="${PN}-lpk-7.7p1-${LDAP_VER}.patch.xz"
401 -
402 -DESCRIPTION="Port of OpenBSD's free SSH release"
403 -HOMEPAGE="https://www.openssh.com/"
404 -SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
405 - ${SCTP_PATCH:+sctp? ( https://dev.gentoo.org/~whissi/dist/openssh/${SCTP_PATCH} )}
406 - ${HPN_PATCH:+hpn? ( https://dev.gentoo.org/~whissi/dist/openssh/${HPN_PATCH} )}
407 - ${LDAP_PATCH:+ldap? ( https://dev.gentoo.org/~whissi/dist/openssh/${LDAP_PATCH} )}
408 - ${X509_PATCH:+X509? ( https://dev.gentoo.org/~whissi/dist/openssh/${X509_PATCH} )}
409 - "
410 -
411 -LICENSE="BSD GPL-2"
412 -SLOT="0"
413 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
414 -# Probably want to drop ssl defaulting to on in a future version.
415 -IUSE="abi_mips_n32 audit bindist debug hpn kerberos kernel_linux ldap ldns libedit libressl livecd pam +pie sctp selinux skey +ssl static test X X509"
416 -REQUIRED_USE="ldns? ( ssl )
417 - pie? ( !static )
418 - static? ( !kerberos !pam )
419 - X509? ( !ldap !sctp ssl )
420 - test? ( ssl )"
421 -
422 -LIB_DEPEND="
423 - audit? ( sys-process/audit[static-libs(+)] )
424 - ldns? (
425 - net-libs/ldns[static-libs(+)]
426 - !bindist? ( net-libs/ldns[ecdsa,ssl(+)] )
427 - bindist? ( net-libs/ldns[-ecdsa,ssl(+)] )
428 - )
429 - libedit? ( dev-libs/libedit:=[static-libs(+)] )
430 - sctp? ( net-misc/lksctp-tools[static-libs(+)] )
431 - selinux? ( >=sys-libs/libselinux-1.28[static-libs(+)] )
432 - skey? ( >=sys-auth/skey-1.1.5-r1[static-libs(+)] )
433 - ssl? (
434 - !libressl? (
435 - >=dev-libs/openssl-1.0.1:0=[bindist=]
436 - dev-libs/openssl:0=[static-libs(+)]
437 - )
438 - libressl? ( dev-libs/libressl:0=[static-libs(+)] )
439 - )
440 - >=sys-libs/zlib-1.2.3:=[static-libs(+)]"
441 -RDEPEND="
442 - !static? ( ${LIB_DEPEND//\[static-libs(+)]} )
443 - pam? ( virtual/pam )
444 - kerberos? ( virtual/krb5 )
445 - ldap? ( net-nds/openldap )"
446 -DEPEND="${RDEPEND}
447 - static? ( ${LIB_DEPEND} )
448 - virtual/pkgconfig
449 - virtual/os-headers
450 - sys-devel/autoconf"
451 -RDEPEND="${RDEPEND}
452 - pam? ( >=sys-auth/pambase-20081028 )
453 - userland_GNU? ( virtual/shadow )
454 - X? ( x11-apps/xauth )"
455 -
456 -S="${WORKDIR}/${PARCH}"
457 -
458 -pkg_pretend() {
459 - # this sucks, but i'd rather have people unable to `emerge -u openssh`
460 - # than not be able to log in to their server any more
461 - maybe_fail() { [[ -z ${!2} ]] && echo "$1" ; }
462 - local fail="
463 - $(use hpn && maybe_fail hpn HPN_PATCH)
464 - $(use ldap && maybe_fail ldap LDAP_PATCH)
465 - $(use sctp && maybe_fail sctp SCTP_PATCH)
466 - $(use X509 && maybe_fail X509 X509_PATCH)
467 - "
468 - fail=$(echo ${fail})
469 - if [[ -n ${fail} ]] ; then
470 - eerror "Sorry, but this version does not yet support features"
471 - eerror "that you requested: ${fail}"
472 - eerror "Please mask ${PF} for now and check back later:"
473 - eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
474 - die "booooo"
475 - fi
476 -
477 - # Make sure people who are using tcp wrappers are notified of its removal. #531156
478 - if grep -qs '^ *sshd *:' "${EROOT%/}"/etc/hosts.{allow,deny} ; then
479 - ewarn "Sorry, but openssh no longer supports tcp-wrappers, and it seems like"
480 - ewarn "you're trying to use it. Update your ${EROOT}etc/hosts.{allow,deny} please."
481 - fi
482 -}
483 -
484 -src_prepare() {
485 - sed -i \
486 - -e "/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:${EPREFIX%/}/usr/bin/xauth:" \
487 - pathnames.h || die
488 -
489 - # don't break .ssh/authorized_keys2 for fun
490 - sed -i '/^AuthorizedKeysFile/s:^:#:' sshd_config || die
491 -
492 - eapply "${FILESDIR}"/${PN}-7.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
493 - eapply "${FILESDIR}"/${PN}-6.7_p1-openssl-ignore-status.patch
494 -
495 - local PATCHSET_VERSION_MACROS=()
496 -
497 - if use X509 ; then
498 - eapply "${WORKDIR}"/${X509_PATCH%.*}
499 -
500 - # We need to patch package version or any X.509 sshd will reject our ssh client
501 - # with "userauth_pubkey: could not parse key: string is too large [preauth]"
502 - # error
503 - einfo "Patching package version for X.509 patch set ..."
504 - sed -i \
505 - -e "s/^AC_INIT(\[OpenSSH\], \[Portable\]/AC_INIT([OpenSSH], [${X509_VER}]/" \
506 - "${S}"/configure.ac || die "Failed to patch package version for X.509 patch"
507 -
508 - einfo "Patching version.h to expose X.509 patch set ..."
509 - sed -i \
510 - -e "/^#define SSH_PORTABLE.*/a #define SSH_X509 \"-PKIXSSH-${X509_VER}\"" \
511 - "${S}"/version.h || die "Failed to sed-in X.509 patch version"
512 - PATCHSET_VERSION_MACROS+=( 'SSH_X509' )
513 -
514 - einfo "Disabling broken X.509 agent test ..."
515 - sed -i \
516 - -e "/^ agent$/d" \
517 - "${S}"/tests/CA/config || die "Failed to disable broken X.509 agent test"
518 - fi
519 -
520 - if use ldap ; then
521 - eapply "${WORKDIR}"/${LDAP_PATCH%.*}
522 -
523 - einfo "Patching version.h to expose LDAP patch set ..."
524 - sed -i \
525 - -e "/^#define SSH_PORTABLE.*/a #define SSH_LDAP \"-ldap-${LDAP_VER}\"" \
526 - "${S}"/version.h || die "Failed to sed-in LDAP patch version"
527 - PATCHSET_VERSION_MACROS+=( 'SSH_LDAP' )
528 - fi
529 -
530 - if use sctp ; then
531 - eapply "${WORKDIR}"/${SCTP_PATCH%.*}
532 -
533 - einfo "Patching version.h to expose SCTP patch set ..."
534 - sed -i \
535 - -e "/^#define SSH_PORTABLE/a #define SSH_SCTP \"-sctp-${SCTP_VER}\"" \
536 - "${S}"/version.h || die "Failed to sed-in SCTP patch version"
537 - PATCHSET_VERSION_MACROS+=( 'SSH_SCTP' )
538 -
539 - einfo "Disabling know failing test (cfgparse) caused by SCTP patch ..."
540 - sed -i \
541 - -e "/\t\tcfgparse \\\/d" \
542 - "${S}"/regress/Makefile || die "Failed to disable known failing test (cfgparse) caused by SCTP patch"
543 - fi
544 -
545 - if use hpn ; then
546 - eapply "${WORKDIR}"/${HPN_PATCH%.*}
547 -
548 - einfo "Patching Makefile.in for HPN patch set ..."
549 - sed -i \
550 - -e "/^LIBS=/ s/\$/ -lpthread/" \
551 - "${S}"/Makefile.in || die "Failed to patch Makefile.in"
552 -
553 - einfo "Patching version.h to expose HPN patch set ..."
554 - sed -i \
555 - -e "/^#define SSH_PORTABLE/a #define SSH_HPN \"-hpn${HPN_VER}\"" \
556 - "${S}"/version.h || die "Failed to sed-in HPN patch version"
557 - PATCHSET_VERSION_MACROS+=( 'SSH_HPN' )
558 -
559 - if [[ -n "${HPN_DISABLE_MTAES}" ]] ; then
560 - einfo "Disabling known non-working MT AES cipher per default ..."
561 -
562 - cat > "${T}"/disable_mtaes.conf <<- EOF
563 -
564 - # HPN's Multi-Threaded AES CTR cipher is currently known to be broken
565 - # and therefore disabled per default.
566 - DisableMTAES yes
567 - EOF
568 - sed -i \
569 - -e "/^#HPNDisabled.*/r ${T}/disable_mtaes.conf" \
570 - "${S}"/sshd_config || die "Failed to disabled MT AES ciphers in sshd_config"
571 -
572 - sed -i \
573 - -e "/AcceptEnv.*_XXX_TEST$/a \\\tDisableMTAES\t\tyes" \
574 - "${S}"/regress/test-exec.sh || die "Failed to disable MT AES ciphers in test config"
575 - fi
576 - fi
577 -
578 - if use X509 || use hpn ; then
579 - einfo "Patching packet.c for X509 and/or HPN patch set ..."
580 - sed -i \
581 - -e "s/const struct sshcipher/struct sshcipher/" \
582 - "${S}"/packet.c || die "Failed to patch ssh_packet_set_connection() (packet.c)"
583 - fi
584 -
585 - if use X509 || use sctp || use ldap || use hpn ; then
586 - einfo "Patching sshconnect.c to use SSH_RELEASE in send_client_banner() ..."
587 - sed -i \
588 - -e "s/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_RELEASE/" \
589 - "${S}"/sshconnect.c || die "Failed to patch send_client_banner() to use SSH_RELEASE (sshconnect.c)"
590 -
591 - einfo "Patching sshd.c to use SSH_RELEASE in sshd_exchange_identification() ..."
592 - sed -i \
593 - -e "s/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_RELEASE/" \
594 - "${S}"/sshd.c || die "Failed to patch sshd_exchange_identification() to use SSH_RELEASE (sshd.c)"
595 -
596 - einfo "Patching version.h to add our patch sets to SSH_RELEASE ..."
597 - sed -i \
598 - -e "s/^#define SSH_RELEASE.*/#define SSH_RELEASE SSH_VERSION SSH_PORTABLE ${PATCHSET_VERSION_MACROS[*]}/" \
599 - "${S}"/version.h || die "Failed to patch SSH_RELEASE (version.h)"
600 - fi
601 -
602 - eapply_user #473004
603 -
604 - tc-export PKG_CONFIG
605 - local sed_args=(
606 - -e "s:-lcrypto:$(${PKG_CONFIG} --libs openssl):"
607 - # Disable PATH reset, trust what portage gives us #254615
608 - -e 's:^PATH=/:#PATH=/:'
609 - # Disable fortify flags ... our gcc does this for us
610 - -e 's:-D_FORTIFY_SOURCE=2::'
611 - )
612 -
613 - # The -ftrapv flag ICEs on hppa #505182
614 - use hppa && sed_args+=(
615 - -e '/CFLAGS/s:-ftrapv:-fdisable-this-test:'
616 - -e '/OSSH_CHECK_CFLAG_LINK.*-ftrapv/d'
617 - )
618 - # _XOPEN_SOURCE causes header conflicts on Solaris
619 - [[ ${CHOST} == *-solaris* ]] && sed_args+=(
620 - -e 's/-D_XOPEN_SOURCE//'
621 - )
622 - sed -i "${sed_args[@]}" configure{.ac,} || die
623 -
624 - eautoreconf
625 -}
626 -
627 -src_configure() {
628 - addwrite /dev/ptmx
629 -
630 - use debug && append-cppflags -DSANDBOX_SECCOMP_FILTER_DEBUG
631 - use static && append-ldflags -static
632 -
633 - local myconf=(
634 - --with-ldflags="${LDFLAGS}"
635 - --disable-strip
636 - --with-pid-dir="${EPREFIX}"$(usex kernel_linux '' '/var')/run
637 - --sysconfdir="${EPREFIX%/}"/etc/ssh
638 - --libexecdir="${EPREFIX%/}"/usr/$(get_libdir)/misc
639 - --datadir="${EPREFIX%/}"/usr/share/openssh
640 - --with-privsep-path="${EPREFIX%/}"/var/empty
641 - --with-privsep-user=sshd
642 - $(use_with audit audit linux)
643 - $(use_with kerberos kerberos5 "${EPREFIX%/}"/usr)
644 - # We apply the ldap and sctp patch conditionally, so can't pass --without-{ldap,sctp}
645 - # unconditionally else we get unknown flag warnings.
646 - $(use ldap && use_with ldap)
647 - $(use sctp && use_with sctp)
648 - $(use_with ldns)
649 - $(use_with libedit)
650 - $(use_with pam)
651 - $(use_with pie)
652 - $(use_with selinux)
653 - $(use_with skey)
654 - $(use_with ssl openssl)
655 - $(use_with ssl md5-passwords)
656 - $(use_with ssl ssl-engine)
657 - )
658 -
659 - # The seccomp sandbox is broken on x32, so use the older method for now. #553748
660 - use amd64 && [[ ${ABI} == "x32" ]] && myconf+=( --with-sandbox=rlimit )
661 -
662 - econf "${myconf[@]}"
663 -}
664 -
665 -src_test() {
666 - local t skipped=() failed=() passed=()
667 - local tests=( interop-tests compat-tests )
668 -
669 - local shell=$(egetshell "${UID}")
670 - if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
671 - elog "Running the full OpenSSH testsuite requires a usable shell for the 'portage'"
672 - elog "user, so we will run a subset only."
673 - skipped+=( tests )
674 - else
675 - tests+=( tests )
676 - fi
677 -
678 - # It will also attempt to write to the homedir .ssh.
679 - local sshhome=${T}/homedir
680 - mkdir -p "${sshhome}"/.ssh
681 - for t in "${tests[@]}" ; do
682 - # Some tests read from stdin ...
683 - HOMEDIR="${sshhome}" HOME="${sshhome}" \
684 - emake -k -j1 ${t} </dev/null \
685 - && passed+=( "${t}" ) \
686 - || failed+=( "${t}" )
687 - done
688 -
689 - einfo "Passed tests: ${passed[*]}"
690 - [[ ${#skipped[@]} -gt 0 ]] && ewarn "Skipped tests: ${skipped[*]}"
691 - [[ ${#failed[@]} -gt 0 ]] && die "Some tests failed: ${failed[*]}"
692 -}
693 -
694 -src_install() {
695 - emake install-nokeys DESTDIR="${D}"
696 - fperms 600 /etc/ssh/sshd_config
697 - dobin contrib/ssh-copy-id
698 - newinitd "${FILESDIR}"/sshd.rc6.5 sshd
699 - newconfd "${FILESDIR}"/sshd-r1.confd sshd
700 -
701 - newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
702 - if use pam ; then
703 - sed -i \
704 - -e "/^#UsePAM /s:.*:UsePAM yes:" \
705 - -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
706 - -e "/^#PrintMotd /s:.*:PrintMotd no:" \
707 - -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
708 - "${ED%/}"/etc/ssh/sshd_config || die
709 - fi
710 -
711 - # Gentoo tweaks to default config files
712 - cat <<-EOF >> "${ED%/}"/etc/ssh/sshd_config
713 -
714 - # Allow client to pass locale environment variables #367017
715 - AcceptEnv LANG LC_*
716 - EOF
717 - cat <<-EOF >> "${ED%/}"/etc/ssh/ssh_config
718 -
719 - # Send locale environment variables #367017
720 - SendEnv LANG LC_*
721 - EOF
722 -
723 - if use livecd ; then
724 - sed -i \
725 - -e '/^#PermitRootLogin/c# Allow root login with password on livecds.\nPermitRootLogin Yes' \
726 - "${ED%/}"/etc/ssh/sshd_config || die
727 - fi
728 -
729 - if use ldap && [[ -n ${LDAP_PATCH} ]] ; then
730 - insinto /etc/openldap/schema/
731 - newins openssh-lpk_openldap.schema openssh-lpk.schema
732 - fi
733 -
734 - doman contrib/ssh-copy-id.1
735 - dodoc CREDITS OVERVIEW README* TODO sshd_config
736 - use hpn && dodoc HPN-README
737 - use X509 || dodoc ChangeLog
738 -
739 - diropts -m 0700
740 - dodir /etc/skel/.ssh
741 -
742 - keepdir /var/empty
743 -
744 - systemd_dounit "${FILESDIR}"/sshd.{service,socket}
745 - systemd_newunit "${FILESDIR}"/sshd_at.service 'sshd@.service'
746 -}
747 -
748 -pkg_preinst() {
749 - enewgroup sshd 22
750 - enewuser sshd 22 -1 /var/empty sshd
751 -}
752 -
753 -pkg_postinst() {
754 - if has_version "<${CATEGORY}/${PN}-5.8_p1" ; then
755 - elog "Starting with openssh-5.8p1, the server will default to a newer key"
756 - elog "algorithm (ECDSA). You are encouraged to manually update your stored"
757 - elog "keys list as servers update theirs. See ssh-keyscan(1) for more info."
758 - fi
759 - if has_version "<${CATEGORY}/${PN}-7.0_p1" ; then
760 - elog "Starting with openssh-6.7, support for USE=tcpd has been dropped by upstream."
761 - elog "Make sure to update any configs that you might have. Note that xinetd might"
762 - elog "be an alternative for you as it supports USE=tcpd."
763 - fi
764 - if has_version "<${CATEGORY}/${PN}-7.1_p1" ; then #557388 #555518
765 - elog "Starting with openssh-7.0, support for ssh-dss keys were disabled due to their"
766 - elog "weak sizes. If you rely on these key types, you can re-enable the key types by"
767 - elog "adding to your sshd_config or ~/.ssh/config files:"
768 - elog " PubkeyAcceptedKeyTypes=+ssh-dss"
769 - elog "You should however generate new keys using rsa or ed25519."
770 -
771 - elog "Starting with openssh-7.0, the default for PermitRootLogin changed from 'yes'"
772 - elog "to 'prohibit-password'. That means password auth for root users no longer works"
773 - elog "out of the box. If you need this, please update your sshd_config explicitly."
774 - fi
775 - if has_version "<${CATEGORY}/${PN}-7.6_p1" ; then
776 - elog "Starting with openssh-7.6p1, openssh upstream has removed ssh1 support entirely."
777 - elog "Furthermore, rsa keys with less than 1024 bits will be refused."
778 - fi
779 - if ! use ssl && has_version "${CATEGORY}/${PN}[ssl]" ; then
780 - elog "Be aware that by disabling openssl support in openssh, the server and clients"
781 - elog "no longer support dss/rsa/ecdsa keys. You will need to generate ed25519 keys"
782 - elog "and update all clients/servers that utilize them."
783 - fi
784 -
785 - if use hpn && [[ -n "${HPN_DISABLE_MTAES}" ]] ; then
786 - elog ""
787 - elog "HPN's multi-threaded AES CTR cipher is currently known to be broken"
788 - elog "and therefore disabled at runtime per default."
789 - elog "Make sure your sshd_config is up to date and contains"
790 - elog ""
791 - elog " DisableMTAES yes"
792 - elog ""
793 - elog "Otherwise you maybe unable to connect to this sshd using any AES CTR cipher."
794 - elog ""
795 - fi
796 -}
797
798 diff --git a/net-misc/openssh/openssh-7.7_p1-r2.ebuild b/net-misc/openssh/openssh-7.7_p1-r2.ebuild
799 deleted file mode 100644
800 index cb49cc970e0..00000000000
801 --- a/net-misc/openssh/openssh-7.7_p1-r2.ebuild
802 +++ /dev/null
803 @@ -1,426 +0,0 @@
804 -# Copyright 1999-2018 Gentoo Foundation
805 -# Distributed under the terms of the GNU General Public License v2
806 -
807 -EAPI=6
808 -
809 -inherit user flag-o-matic multilib autotools pam systemd versionator
810 -
811 -# Make it more portable between straight releases
812 -# and _p? releases.
813 -PARCH=${P/_}
814 -
815 -HPN_VER="14v14-gentoo1" HPN_PATCH="${PARCH}-hpnssh${HPN_VER}.patch.xz" HPN_DISABLE_MTAES=1
816 -SCTP_VER="1.0" SCTP_PATCH="${PARCH}-sctp-${SCTP_VER}.patch.xz"
817 -X509_VER="11.3.1" X509_PATCH="${PARCH}-x509-${X509_VER}.patch.xz"
818 -
819 -# Disable LDAP support until someone will rewrite the patch,
820 -# upstream removed auth_parse_options() via commit 7c856857607112a3dfe6414696bf4c7ab7fb0cb3
821 -#LDAP_VER="0.3.14" LDAP_PATCH="${PN}-lpk-7.7p1-${LDAP_VER}.patch.xz"
822 -
823 -PATCH_SET="openssh-7.7p1-patches-1.0"
824 -
825 -DESCRIPTION="Port of OpenBSD's free SSH release"
826 -HOMEPAGE="https://www.openssh.com/"
827 -SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
828 - https://dev.gentoo.org/~whissi/dist/${PN}/${PATCH_SET}.tar.xz
829 - ${SCTP_PATCH:+sctp? ( https://dev.gentoo.org/~whissi/dist/openssh/${SCTP_PATCH} )}
830 - ${HPN_PATCH:+hpn? ( https://dev.gentoo.org/~whissi/dist/openssh/${HPN_PATCH} )}
831 - ${LDAP_PATCH:+ldap? ( https://dev.gentoo.org/~whissi/dist/openssh/${LDAP_PATCH} )}
832 - ${X509_PATCH:+X509? ( https://dev.gentoo.org/~whissi/dist/openssh/${X509_PATCH} )}
833 - "
834 -
835 -LICENSE="BSD GPL-2"
836 -SLOT="0"
837 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
838 -# Probably want to drop ssl defaulting to on in a future version.
839 -IUSE="abi_mips_n32 audit bindist debug hpn kerberos kernel_linux ldap ldns libedit libressl livecd pam +pie sctp selinux skey +ssl static test X X509"
840 -REQUIRED_USE="ldns? ( ssl )
841 - pie? ( !static )
842 - static? ( !kerberos !pam )
843 - X509? ( !ldap !sctp ssl )
844 - test? ( ssl )"
845 -
846 -LIB_DEPEND="
847 - audit? ( sys-process/audit[static-libs(+)] )
848 - ldns? (
849 - net-libs/ldns[static-libs(+)]
850 - !bindist? ( net-libs/ldns[ecdsa,ssl(+)] )
851 - bindist? ( net-libs/ldns[-ecdsa,ssl(+)] )
852 - )
853 - libedit? ( dev-libs/libedit:=[static-libs(+)] )
854 - sctp? ( net-misc/lksctp-tools[static-libs(+)] )
855 - selinux? ( >=sys-libs/libselinux-1.28[static-libs(+)] )
856 - skey? ( >=sys-auth/skey-1.1.5-r1[static-libs(+)] )
857 - ssl? (
858 - !libressl? (
859 - >=dev-libs/openssl-1.0.1:0=[bindist=]
860 - dev-libs/openssl:0=[static-libs(+)]
861 - )
862 - libressl? ( dev-libs/libressl:0=[static-libs(+)] )
863 - )
864 - >=sys-libs/zlib-1.2.3:=[static-libs(+)]"
865 -RDEPEND="
866 - !static? ( ${LIB_DEPEND//\[static-libs(+)]} )
867 - pam? ( virtual/pam )
868 - kerberos? ( virtual/krb5 )
869 - ldap? ( net-nds/openldap )"
870 -DEPEND="${RDEPEND}
871 - static? ( ${LIB_DEPEND} )
872 - virtual/pkgconfig
873 - virtual/os-headers
874 - sys-devel/autoconf"
875 -RDEPEND="${RDEPEND}
876 - pam? ( >=sys-auth/pambase-20081028 )
877 - userland_GNU? ( virtual/shadow )
878 - X? ( x11-apps/xauth )"
879 -
880 -S="${WORKDIR}/${PARCH}"
881 -
882 -pkg_pretend() {
883 - # this sucks, but i'd rather have people unable to `emerge -u openssh`
884 - # than not be able to log in to their server any more
885 - maybe_fail() { [[ -z ${!2} ]] && echo "$1" ; }
886 - local fail="
887 - $(use hpn && maybe_fail hpn HPN_PATCH)
888 - $(use ldap && maybe_fail ldap LDAP_PATCH)
889 - $(use sctp && maybe_fail sctp SCTP_PATCH)
890 - $(use X509 && maybe_fail X509 X509_PATCH)
891 - "
892 - fail=$(echo ${fail})
893 - if [[ -n ${fail} ]] ; then
894 - eerror "Sorry, but this version does not yet support features"
895 - eerror "that you requested: ${fail}"
896 - eerror "Please mask ${PF} for now and check back later:"
897 - eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
898 - die "booooo"
899 - fi
900 -
901 - # Make sure people who are using tcp wrappers are notified of its removal. #531156
902 - if grep -qs '^ *sshd *:' "${EROOT%/}"/etc/hosts.{allow,deny} ; then
903 - ewarn "Sorry, but openssh no longer supports tcp-wrappers, and it seems like"
904 - ewarn "you're trying to use it. Update your ${EROOT}etc/hosts.{allow,deny} please."
905 - fi
906 -}
907 -
908 -src_prepare() {
909 - sed -i \
910 - -e "/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:${EPREFIX%/}/usr/bin/xauth:" \
911 - pathnames.h || die
912 -
913 - # don't break .ssh/authorized_keys2 for fun
914 - sed -i '/^AuthorizedKeysFile/s:^:#:' sshd_config || die
915 -
916 - eapply "${FILESDIR}"/${PN}-7.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
917 - eapply "${FILESDIR}"/${PN}-6.7_p1-openssl-ignore-status.patch
918 -
919 - local PATCHSET_VERSION_MACROS=()
920 -
921 - if use X509 ; then
922 - eapply "${WORKDIR}"/${X509_PATCH%.*}
923 -
924 - # We need to patch package version or any X.509 sshd will reject our ssh client
925 - # with "userauth_pubkey: could not parse key: string is too large [preauth]"
926 - # error
927 - einfo "Patching package version for X.509 patch set ..."
928 - sed -i \
929 - -e "s/^AC_INIT(\[OpenSSH\], \[Portable\]/AC_INIT([OpenSSH], [${X509_VER}]/" \
930 - "${S}"/configure.ac || die "Failed to patch package version for X.509 patch"
931 -
932 - einfo "Patching version.h to expose X.509 patch set ..."
933 - sed -i \
934 - -e "/^#define SSH_PORTABLE.*/a #define SSH_X509 \"-PKIXSSH-${X509_VER}\"" \
935 - "${S}"/version.h || die "Failed to sed-in X.509 patch version"
936 - PATCHSET_VERSION_MACROS+=( 'SSH_X509' )
937 -
938 - einfo "Disabling broken X.509 agent test ..."
939 - sed -i \
940 - -e "/^ agent$/d" \
941 - "${S}"/tests/CA/config || die "Failed to disable broken X.509 agent test"
942 -
943 - # The following patches don't apply on top of X509 patch
944 - rm "${WORKDIR}"/patch/2002_all_openssh-7.7p1_upstream_bug2840.patch || die
945 - rm "${WORKDIR}"/patch/2009_all_openssh-7.7p1_make-shell-tests-portable.patch || die
946 - fi
947 -
948 - if use ldap ; then
949 - eapply "${WORKDIR}"/${LDAP_PATCH%.*}
950 -
951 - einfo "Patching version.h to expose LDAP patch set ..."
952 - sed -i \
953 - -e "/^#define SSH_PORTABLE.*/a #define SSH_LDAP \"-ldap-${LDAP_VER}\"" \
954 - "${S}"/version.h || die "Failed to sed-in LDAP patch version"
955 - PATCHSET_VERSION_MACROS+=( 'SSH_LDAP' )
956 - fi
957 -
958 - if use sctp ; then
959 - eapply "${WORKDIR}"/${SCTP_PATCH%.*}
960 -
961 - einfo "Patching version.h to expose SCTP patch set ..."
962 - sed -i \
963 - -e "/^#define SSH_PORTABLE/a #define SSH_SCTP \"-sctp-${SCTP_VER}\"" \
964 - "${S}"/version.h || die "Failed to sed-in SCTP patch version"
965 - PATCHSET_VERSION_MACROS+=( 'SSH_SCTP' )
966 -
967 - einfo "Disabling know failing test (cfgparse) caused by SCTP patch ..."
968 - sed -i \
969 - -e "/\t\tcfgparse \\\/d" \
970 - "${S}"/regress/Makefile || die "Failed to disable known failing test (cfgparse) caused by SCTP patch"
971 - fi
972 -
973 - if use hpn ; then
974 - eapply "${WORKDIR}"/${HPN_PATCH%.*}
975 -
976 - einfo "Patching Makefile.in for HPN patch set ..."
977 - sed -i \
978 - -e "/^LIBS=/ s/\$/ -lpthread/" \
979 - "${S}"/Makefile.in || die "Failed to patch Makefile.in"
980 -
981 - einfo "Patching version.h to expose HPN patch set ..."
982 - sed -i \
983 - -e "/^#define SSH_PORTABLE/a #define SSH_HPN \"-hpn${HPN_VER}\"" \
984 - "${S}"/version.h || die "Failed to sed-in HPN patch version"
985 - PATCHSET_VERSION_MACROS+=( 'SSH_HPN' )
986 -
987 - if [[ -n "${HPN_DISABLE_MTAES}" ]] ; then
988 - einfo "Disabling known non-working MT AES cipher per default ..."
989 -
990 - cat > "${T}"/disable_mtaes.conf <<- EOF
991 -
992 - # HPN's Multi-Threaded AES CTR cipher is currently known to be broken
993 - # and therefore disabled per default.
994 - DisableMTAES yes
995 - EOF
996 - sed -i \
997 - -e "/^#HPNDisabled.*/r ${T}/disable_mtaes.conf" \
998 - "${S}"/sshd_config || die "Failed to disabled MT AES ciphers in sshd_config"
999 -
1000 - sed -i \
1001 - -e "/AcceptEnv.*_XXX_TEST$/a \\\tDisableMTAES\t\tyes" \
1002 - "${S}"/regress/test-exec.sh || die "Failed to disable MT AES ciphers in test config"
1003 - fi
1004 - fi
1005 -
1006 - if use X509 || use hpn ; then
1007 - einfo "Patching packet.c for X509 and/or HPN patch set ..."
1008 - sed -i \
1009 - -e "s/const struct sshcipher/struct sshcipher/" \
1010 - "${S}"/packet.c || die "Failed to patch ssh_packet_set_connection() (packet.c)"
1011 - fi
1012 -
1013 - if use X509 || use sctp || use ldap || use hpn ; then
1014 - einfo "Patching sshconnect.c to use SSH_RELEASE in send_client_banner() ..."
1015 - sed -i \
1016 - -e "s/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_RELEASE/" \
1017 - "${S}"/sshconnect.c || die "Failed to patch send_client_banner() to use SSH_RELEASE (sshconnect.c)"
1018 -
1019 - einfo "Patching sshd.c to use SSH_RELEASE in sshd_exchange_identification() ..."
1020 - sed -i \
1021 - -e "s/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_RELEASE/" \
1022 - "${S}"/sshd.c || die "Failed to patch sshd_exchange_identification() to use SSH_RELEASE (sshd.c)"
1023 -
1024 - einfo "Patching version.h to add our patch sets to SSH_RELEASE ..."
1025 - sed -i \
1026 - -e "s/^#define SSH_RELEASE.*/#define SSH_RELEASE SSH_VERSION SSH_PORTABLE ${PATCHSET_VERSION_MACROS[*]}/" \
1027 - "${S}"/version.h || die "Failed to patch SSH_RELEASE (version.h)"
1028 - fi
1029 -
1030 - sed -i \
1031 - -e "/#UseLogin no/d" \
1032 - "${S}"/sshd_config || die "Failed to remove removed UseLogin option (sshd_config)"
1033 - eapply "${WORKDIR}"/patch/*.patch
1034 -
1035 - eapply_user #473004
1036 -
1037 - tc-export PKG_CONFIG
1038 - local sed_args=(
1039 - -e "s:-lcrypto:$(${PKG_CONFIG} --libs openssl):"
1040 - # Disable PATH reset, trust what portage gives us #254615
1041 - -e 's:^PATH=/:#PATH=/:'
1042 - # Disable fortify flags ... our gcc does this for us
1043 - -e 's:-D_FORTIFY_SOURCE=2::'
1044 - )
1045 -
1046 - # The -ftrapv flag ICEs on hppa #505182
1047 - use hppa && sed_args+=(
1048 - -e '/CFLAGS/s:-ftrapv:-fdisable-this-test:'
1049 - -e '/OSSH_CHECK_CFLAG_LINK.*-ftrapv/d'
1050 - )
1051 - # _XOPEN_SOURCE causes header conflicts on Solaris
1052 - [[ ${CHOST} == *-solaris* ]] && sed_args+=(
1053 - -e 's/-D_XOPEN_SOURCE//'
1054 - )
1055 - sed -i "${sed_args[@]}" configure{.ac,} || die
1056 -
1057 - eautoreconf
1058 -}
1059 -
1060 -src_configure() {
1061 - addwrite /dev/ptmx
1062 -
1063 - use debug && append-cppflags -DSANDBOX_SECCOMP_FILTER_DEBUG
1064 - use static && append-ldflags -static
1065 -
1066 - local myconf=(
1067 - --with-ldflags="${LDFLAGS}"
1068 - --disable-strip
1069 - --with-pid-dir="${EPREFIX}"$(usex kernel_linux '' '/var')/run
1070 - --sysconfdir="${EPREFIX%/}"/etc/ssh
1071 - --libexecdir="${EPREFIX%/}"/usr/$(get_libdir)/misc
1072 - --datadir="${EPREFIX%/}"/usr/share/openssh
1073 - --with-privsep-path="${EPREFIX%/}"/var/empty
1074 - --with-privsep-user=sshd
1075 - $(use_with audit audit linux)
1076 - $(use_with kerberos kerberos5 "${EPREFIX%/}"/usr)
1077 - # We apply the ldap and sctp patch conditionally, so can't pass --without-{ldap,sctp}
1078 - # unconditionally else we get unknown flag warnings.
1079 - $(use ldap && use_with ldap)
1080 - $(use sctp && use_with sctp)
1081 - $(use_with ldns)
1082 - $(use_with libedit)
1083 - $(use_with pam)
1084 - $(use_with pie)
1085 - $(use_with selinux)
1086 - $(use_with skey)
1087 - $(use_with ssl openssl)
1088 - $(use_with ssl md5-passwords)
1089 - $(use_with ssl ssl-engine)
1090 - )
1091 -
1092 - # The seccomp sandbox is broken on x32, so use the older method for now. #553748
1093 - use amd64 && [[ ${ABI} == "x32" ]] && myconf+=( --with-sandbox=rlimit )
1094 -
1095 - econf "${myconf[@]}"
1096 -}
1097 -
1098 -src_test() {
1099 - local t skipped=() failed=() passed=()
1100 - local tests=( interop-tests compat-tests )
1101 -
1102 - local shell=$(egetshell "${UID}")
1103 - if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
1104 - elog "Running the full OpenSSH testsuite requires a usable shell for the 'portage'"
1105 - elog "user, so we will run a subset only."
1106 - skipped+=( tests )
1107 - else
1108 - tests+=( tests )
1109 - fi
1110 -
1111 - # It will also attempt to write to the homedir .ssh.
1112 - local sshhome=${T}/homedir
1113 - mkdir -p "${sshhome}"/.ssh
1114 - for t in "${tests[@]}" ; do
1115 - # Some tests read from stdin ...
1116 - HOMEDIR="${sshhome}" HOME="${sshhome}" \
1117 - emake -k -j1 ${t} </dev/null \
1118 - && passed+=( "${t}" ) \
1119 - || failed+=( "${t}" )
1120 - done
1121 -
1122 - einfo "Passed tests: ${passed[*]}"
1123 - [[ ${#skipped[@]} -gt 0 ]] && ewarn "Skipped tests: ${skipped[*]}"
1124 - [[ ${#failed[@]} -gt 0 ]] && die "Some tests failed: ${failed[*]}"
1125 -}
1126 -
1127 -src_install() {
1128 - emake install-nokeys DESTDIR="${D}"
1129 - fperms 600 /etc/ssh/sshd_config
1130 - dobin contrib/ssh-copy-id
1131 - newinitd "${FILESDIR}"/sshd.rc6.5 sshd
1132 - newconfd "${FILESDIR}"/sshd-r1.confd sshd
1133 -
1134 - newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
1135 - if use pam ; then
1136 - sed -i \
1137 - -e "/^#UsePAM /s:.*:UsePAM yes:" \
1138 - -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
1139 - -e "/^#PrintMotd /s:.*:PrintMotd no:" \
1140 - -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
1141 - "${ED%/}"/etc/ssh/sshd_config || die
1142 - fi
1143 -
1144 - # Gentoo tweaks to default config files
1145 - cat <<-EOF >> "${ED%/}"/etc/ssh/sshd_config
1146 -
1147 - # Allow client to pass locale environment variables #367017
1148 - AcceptEnv LANG LC_*
1149 - EOF
1150 - cat <<-EOF >> "${ED%/}"/etc/ssh/ssh_config
1151 -
1152 - # Send locale environment variables #367017
1153 - SendEnv LANG LC_*
1154 - EOF
1155 -
1156 - if use livecd ; then
1157 - sed -i \
1158 - -e '/^#PermitRootLogin/c# Allow root login with password on livecds.\nPermitRootLogin Yes' \
1159 - "${ED%/}"/etc/ssh/sshd_config || die
1160 - fi
1161 -
1162 - if use ldap && [[ -n ${LDAP_PATCH} ]] ; then
1163 - insinto /etc/openldap/schema/
1164 - newins openssh-lpk_openldap.schema openssh-lpk.schema
1165 - fi
1166 -
1167 - doman contrib/ssh-copy-id.1
1168 - dodoc CREDITS OVERVIEW README* TODO sshd_config
1169 - use hpn && dodoc HPN-README
1170 - use X509 || dodoc ChangeLog
1171 -
1172 - diropts -m 0700
1173 - dodir /etc/skel/.ssh
1174 -
1175 - keepdir /var/empty
1176 -
1177 - systemd_dounit "${FILESDIR}"/sshd.{service,socket}
1178 - systemd_newunit "${FILESDIR}"/sshd_at.service 'sshd@.service'
1179 -}
1180 -
1181 -pkg_preinst() {
1182 - enewgroup sshd 22
1183 - enewuser sshd 22 -1 /var/empty sshd
1184 -}
1185 -
1186 -pkg_postinst() {
1187 - if has_version "<${CATEGORY}/${PN}-5.8_p1" ; then
1188 - elog "Starting with openssh-5.8p1, the server will default to a newer key"
1189 - elog "algorithm (ECDSA). You are encouraged to manually update your stored"
1190 - elog "keys list as servers update theirs. See ssh-keyscan(1) for more info."
1191 - fi
1192 - if has_version "<${CATEGORY}/${PN}-7.0_p1" ; then
1193 - elog "Starting with openssh-6.7, support for USE=tcpd has been dropped by upstream."
1194 - elog "Make sure to update any configs that you might have. Note that xinetd might"
1195 - elog "be an alternative for you as it supports USE=tcpd."
1196 - fi
1197 - if has_version "<${CATEGORY}/${PN}-7.1_p1" ; then #557388 #555518
1198 - elog "Starting with openssh-7.0, support for ssh-dss keys were disabled due to their"
1199 - elog "weak sizes. If you rely on these key types, you can re-enable the key types by"
1200 - elog "adding to your sshd_config or ~/.ssh/config files:"
1201 - elog " PubkeyAcceptedKeyTypes=+ssh-dss"
1202 - elog "You should however generate new keys using rsa or ed25519."
1203 -
1204 - elog "Starting with openssh-7.0, the default for PermitRootLogin changed from 'yes'"
1205 - elog "to 'prohibit-password'. That means password auth for root users no longer works"
1206 - elog "out of the box. If you need this, please update your sshd_config explicitly."
1207 - fi
1208 - if has_version "<${CATEGORY}/${PN}-7.6_p1" ; then
1209 - elog "Starting with openssh-7.6p1, openssh upstream has removed ssh1 support entirely."
1210 - elog "Furthermore, rsa keys with less than 1024 bits will be refused."
1211 - fi
1212 - if ! use ssl && has_version "${CATEGORY}/${PN}[ssl]" ; then
1213 - elog "Be aware that by disabling openssl support in openssh, the server and clients"
1214 - elog "no longer support dss/rsa/ecdsa keys. You will need to generate ed25519 keys"
1215 - elog "and update all clients/servers that utilize them."
1216 - fi
1217 -
1218 - if use hpn && [[ -n "${HPN_DISABLE_MTAES}" ]] ; then
1219 - elog ""
1220 - elog "HPN's multi-threaded AES CTR cipher is currently known to be broken"
1221 - elog "and therefore disabled at runtime per default."
1222 - elog "Make sure your sshd_config is up to date and contains"
1223 - elog ""
1224 - elog " DisableMTAES yes"
1225 - elog ""
1226 - elog "Otherwise you maybe unable to connect to this sshd using any AES CTR cipher."
1227 - elog ""
1228 - fi
1229 -}
1230
1231 diff --git a/net-misc/openssh/openssh-7.7_p1-r3.ebuild b/net-misc/openssh/openssh-7.7_p1-r3.ebuild
1232 deleted file mode 100644
1233 index b06772ba1b8..00000000000
1234 --- a/net-misc/openssh/openssh-7.7_p1-r3.ebuild
1235 +++ /dev/null
1236 @@ -1,427 +0,0 @@
1237 -# Copyright 1999-2018 Gentoo Foundation
1238 -# Distributed under the terms of the GNU General Public License v2
1239 -
1240 -EAPI=6
1241 -
1242 -inherit user flag-o-matic multilib autotools pam systemd versionator
1243 -
1244 -# Make it more portable between straight releases
1245 -# and _p? releases.
1246 -PARCH=${P/_}
1247 -
1248 -HPN_VER="14v15-gentoo1" HPN_PATCH="${PARCH}-hpnssh${HPN_VER}.patch.xz"
1249 -SCTP_VER="1.0" SCTP_PATCH="${PARCH}-sctp-${SCTP_VER}.patch.xz"
1250 -X509_VER="11.3.1" X509_PATCH="${PARCH}-x509-${X509_VER}.patch.xz"
1251 -
1252 -# Disable LDAP support until someone will rewrite the patch,
1253 -# upstream removed auth_parse_options() via commit 7c856857607112a3dfe6414696bf4c7ab7fb0cb3
1254 -#LDAP_VER="0.3.14" LDAP_PATCH="${PN}-lpk-7.7p1-${LDAP_VER}.patch.xz"
1255 -
1256 -PATCH_SET="openssh-7.7p1-patches-1.0"
1257 -
1258 -DESCRIPTION="Port of OpenBSD's free SSH release"
1259 -HOMEPAGE="https://www.openssh.com/"
1260 -SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
1261 - https://dev.gentoo.org/~whissi/dist/${PN}/${PATCH_SET}.tar.xz
1262 - ${SCTP_PATCH:+sctp? ( https://dev.gentoo.org/~whissi/dist/openssh/${SCTP_PATCH} )}
1263 - ${HPN_PATCH:+hpn? ( https://dev.gentoo.org/~whissi/dist/openssh/${HPN_PATCH} )}
1264 - ${LDAP_PATCH:+ldap? ( https://dev.gentoo.org/~whissi/dist/openssh/${LDAP_PATCH} )}
1265 - ${X509_PATCH:+X509? ( https://dev.gentoo.org/~whissi/dist/openssh/${X509_PATCH} )}
1266 - "
1267 -
1268 -LICENSE="BSD GPL-2"
1269 -SLOT="0"
1270 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
1271 -# Probably want to drop ssl defaulting to on in a future version.
1272 -IUSE="abi_mips_n32 audit bindist debug hpn kerberos kernel_linux ldap ldns libedit libressl livecd pam +pie sctp selinux skey +ssl static test X X509"
1273 -REQUIRED_USE="ldns? ( ssl )
1274 - pie? ( !static )
1275 - static? ( !kerberos !pam )
1276 - X509? ( !ldap !sctp ssl )
1277 - test? ( ssl )"
1278 -
1279 -LIB_DEPEND="
1280 - audit? ( sys-process/audit[static-libs(+)] )
1281 - ldns? (
1282 - net-libs/ldns[static-libs(+)]
1283 - !bindist? ( net-libs/ldns[ecdsa,ssl(+)] )
1284 - bindist? ( net-libs/ldns[-ecdsa,ssl(+)] )
1285 - )
1286 - libedit? ( dev-libs/libedit:=[static-libs(+)] )
1287 - sctp? ( net-misc/lksctp-tools[static-libs(+)] )
1288 - selinux? ( >=sys-libs/libselinux-1.28[static-libs(+)] )
1289 - skey? ( >=sys-auth/skey-1.1.5-r1[static-libs(+)] )
1290 - ssl? (
1291 - !libressl? (
1292 - >=dev-libs/openssl-1.0.1:0=[bindist=]
1293 - dev-libs/openssl:0=[static-libs(+)]
1294 - )
1295 - libressl? ( dev-libs/libressl:0=[static-libs(+)] )
1296 - )
1297 - >=sys-libs/zlib-1.2.3:=[static-libs(+)]"
1298 -RDEPEND="
1299 - !static? ( ${LIB_DEPEND//\[static-libs(+)]} )
1300 - pam? ( virtual/pam )
1301 - kerberos? ( virtual/krb5 )
1302 - ldap? ( net-nds/openldap )"
1303 -DEPEND="${RDEPEND}
1304 - static? ( ${LIB_DEPEND} )
1305 - virtual/pkgconfig
1306 - virtual/os-headers
1307 - sys-devel/autoconf"
1308 -RDEPEND="${RDEPEND}
1309 - pam? ( >=sys-auth/pambase-20081028 )
1310 - userland_GNU? ( virtual/shadow )
1311 - X? ( x11-apps/xauth )"
1312 -
1313 -S="${WORKDIR}/${PARCH}"
1314 -
1315 -pkg_pretend() {
1316 - # this sucks, but i'd rather have people unable to `emerge -u openssh`
1317 - # than not be able to log in to their server any more
1318 - maybe_fail() { [[ -z ${!2} ]] && echo "$1" ; }
1319 - local fail="
1320 - $(use hpn && maybe_fail hpn HPN_PATCH)
1321 - $(use ldap && maybe_fail ldap LDAP_PATCH)
1322 - $(use sctp && maybe_fail sctp SCTP_PATCH)
1323 - $(use X509 && maybe_fail X509 X509_PATCH)
1324 - "
1325 - fail=$(echo ${fail})
1326 - if [[ -n ${fail} ]] ; then
1327 - eerror "Sorry, but this version does not yet support features"
1328 - eerror "that you requested: ${fail}"
1329 - eerror "Please mask ${PF} for now and check back later:"
1330 - eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
1331 - die "booooo"
1332 - fi
1333 -
1334 - # Make sure people who are using tcp wrappers are notified of its removal. #531156
1335 - if grep -qs '^ *sshd *:' "${EROOT%/}"/etc/hosts.{allow,deny} ; then
1336 - ewarn "Sorry, but openssh no longer supports tcp-wrappers, and it seems like"
1337 - ewarn "you're trying to use it. Update your ${EROOT}etc/hosts.{allow,deny} please."
1338 - fi
1339 -}
1340 -
1341 -src_prepare() {
1342 - sed -i \
1343 - -e "/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:${EPREFIX%/}/usr/bin/xauth:" \
1344 - pathnames.h || die
1345 -
1346 - # don't break .ssh/authorized_keys2 for fun
1347 - sed -i '/^AuthorizedKeysFile/s:^:#:' sshd_config || die
1348 -
1349 - eapply "${FILESDIR}"/${PN}-7.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
1350 - eapply "${FILESDIR}"/${PN}-6.7_p1-openssl-ignore-status.patch
1351 -
1352 - local PATCHSET_VERSION_MACROS=()
1353 -
1354 - if use X509 ; then
1355 - eapply "${WORKDIR}"/${X509_PATCH%.*}
1356 -
1357 - # We need to patch package version or any X.509 sshd will reject our ssh client
1358 - # with "userauth_pubkey: could not parse key: string is too large [preauth]"
1359 - # error
1360 - einfo "Patching package version for X.509 patch set ..."
1361 - sed -i \
1362 - -e "s/^AC_INIT(\[OpenSSH\], \[Portable\]/AC_INIT([OpenSSH], [${X509_VER}]/" \
1363 - "${S}"/configure.ac || die "Failed to patch package version for X.509 patch"
1364 -
1365 - einfo "Patching version.h to expose X.509 patch set ..."
1366 - sed -i \
1367 - -e "/^#define SSH_PORTABLE.*/a #define SSH_X509 \"-PKIXSSH-${X509_VER}\"" \
1368 - "${S}"/version.h || die "Failed to sed-in X.509 patch version"
1369 - PATCHSET_VERSION_MACROS+=( 'SSH_X509' )
1370 -
1371 - einfo "Disabling broken X.509 agent test ..."
1372 - sed -i \
1373 - -e "/^ agent$/d" \
1374 - "${S}"/tests/CA/config || die "Failed to disable broken X.509 agent test"
1375 -
1376 - # The following patches don't apply on top of X509 patch
1377 - rm "${WORKDIR}"/patch/2002_all_openssh-7.7p1_upstream_bug2840.patch || die
1378 - rm "${WORKDIR}"/patch/2009_all_openssh-7.7p1_make-shell-tests-portable.patch || die
1379 - fi
1380 -
1381 - if use ldap ; then
1382 - eapply "${WORKDIR}"/${LDAP_PATCH%.*}
1383 -
1384 - einfo "Patching version.h to expose LDAP patch set ..."
1385 - sed -i \
1386 - -e "/^#define SSH_PORTABLE.*/a #define SSH_LDAP \"-ldap-${LDAP_VER}\"" \
1387 - "${S}"/version.h || die "Failed to sed-in LDAP patch version"
1388 - PATCHSET_VERSION_MACROS+=( 'SSH_LDAP' )
1389 - fi
1390 -
1391 - if use sctp ; then
1392 - eapply "${WORKDIR}"/${SCTP_PATCH%.*}
1393 -
1394 - einfo "Patching version.h to expose SCTP patch set ..."
1395 - sed -i \
1396 - -e "/^#define SSH_PORTABLE/a #define SSH_SCTP \"-sctp-${SCTP_VER}\"" \
1397 - "${S}"/version.h || die "Failed to sed-in SCTP patch version"
1398 - PATCHSET_VERSION_MACROS+=( 'SSH_SCTP' )
1399 -
1400 - einfo "Disabling know failing test (cfgparse) caused by SCTP patch ..."
1401 - sed -i \
1402 - -e "/\t\tcfgparse \\\/d" \
1403 - "${S}"/regress/Makefile || die "Failed to disable known failing test (cfgparse) caused by SCTP patch"
1404 - fi
1405 -
1406 - if use hpn ; then
1407 - eapply "${WORKDIR}"/${HPN_PATCH%.*}
1408 -
1409 - einfo "Patching Makefile.in for HPN patch set ..."
1410 - sed -i \
1411 - -e "/^LIBS=/ s/\$/ -lpthread/" \
1412 - "${S}"/Makefile.in || die "Failed to patch Makefile.in"
1413 -
1414 - einfo "Patching version.h to expose HPN patch set ..."
1415 - sed -i \
1416 - -e "/^#define SSH_PORTABLE/a #define SSH_HPN \"-hpn${HPN_VER}\"" \
1417 - "${S}"/version.h || die "Failed to sed-in HPN patch version"
1418 - PATCHSET_VERSION_MACROS+=( 'SSH_HPN' )
1419 -
1420 - if [[ -n "${HPN_DISABLE_MTAES}" ]] ; then
1421 - einfo "Disabling known non-working MT AES cipher per default ..."
1422 -
1423 - cat > "${T}"/disable_mtaes.conf <<- EOF
1424 -
1425 - # HPN's Multi-Threaded AES CTR cipher is currently known to be broken
1426 - # and therefore disabled per default.
1427 - DisableMTAES yes
1428 - EOF
1429 - sed -i \
1430 - -e "/^#HPNDisabled.*/r ${T}/disable_mtaes.conf" \
1431 - "${S}"/sshd_config || die "Failed to disabled MT AES ciphers in sshd_config"
1432 -
1433 - sed -i \
1434 - -e "/AcceptEnv.*_XXX_TEST$/a \\\tDisableMTAES\t\tyes" \
1435 - "${S}"/regress/test-exec.sh || die "Failed to disable MT AES ciphers in test config"
1436 - fi
1437 - fi
1438 -
1439 - if use X509 || use hpn ; then
1440 - einfo "Patching packet.c for X509 and/or HPN patch set ..."
1441 - sed -i \
1442 - -e "s/const struct sshcipher/struct sshcipher/" \
1443 - "${S}"/packet.c || die "Failed to patch ssh_packet_set_connection() (packet.c)"
1444 - fi
1445 -
1446 - if use X509 || use sctp || use ldap || use hpn ; then
1447 - einfo "Patching sshconnect.c to use SSH_RELEASE in send_client_banner() ..."
1448 - sed -i \
1449 - -e "s/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_RELEASE/" \
1450 - "${S}"/sshconnect.c || die "Failed to patch send_client_banner() to use SSH_RELEASE (sshconnect.c)"
1451 -
1452 - einfo "Patching sshd.c to use SSH_RELEASE in sshd_exchange_identification() ..."
1453 - sed -i \
1454 - -e "s/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_RELEASE/" \
1455 - "${S}"/sshd.c || die "Failed to patch sshd_exchange_identification() to use SSH_RELEASE (sshd.c)"
1456 -
1457 - einfo "Patching version.h to add our patch sets to SSH_RELEASE ..."
1458 - sed -i \
1459 - -e "s/^#define SSH_RELEASE.*/#define SSH_RELEASE SSH_VERSION SSH_PORTABLE ${PATCHSET_VERSION_MACROS[*]}/" \
1460 - "${S}"/version.h || die "Failed to patch SSH_RELEASE (version.h)"
1461 - fi
1462 -
1463 - sed -i \
1464 - -e "/#UseLogin no/d" \
1465 - "${S}"/sshd_config || die "Failed to remove removed UseLogin option (sshd_config)"
1466 -
1467 - eapply "${WORKDIR}"/patch/*.patch
1468 -
1469 - eapply_user #473004
1470 -
1471 - tc-export PKG_CONFIG
1472 - local sed_args=(
1473 - -e "s:-lcrypto:$(${PKG_CONFIG} --libs openssl):"
1474 - # Disable PATH reset, trust what portage gives us #254615
1475 - -e 's:^PATH=/:#PATH=/:'
1476 - # Disable fortify flags ... our gcc does this for us
1477 - -e 's:-D_FORTIFY_SOURCE=2::'
1478 - )
1479 -
1480 - # The -ftrapv flag ICEs on hppa #505182
1481 - use hppa && sed_args+=(
1482 - -e '/CFLAGS/s:-ftrapv:-fdisable-this-test:'
1483 - -e '/OSSH_CHECK_CFLAG_LINK.*-ftrapv/d'
1484 - )
1485 - # _XOPEN_SOURCE causes header conflicts on Solaris
1486 - [[ ${CHOST} == *-solaris* ]] && sed_args+=(
1487 - -e 's/-D_XOPEN_SOURCE//'
1488 - )
1489 - sed -i "${sed_args[@]}" configure{.ac,} || die
1490 -
1491 - eautoreconf
1492 -}
1493 -
1494 -src_configure() {
1495 - addwrite /dev/ptmx
1496 -
1497 - use debug && append-cppflags -DSANDBOX_SECCOMP_FILTER_DEBUG
1498 - use static && append-ldflags -static
1499 -
1500 - local myconf=(
1501 - --with-ldflags="${LDFLAGS}"
1502 - --disable-strip
1503 - --with-pid-dir="${EPREFIX}"$(usex kernel_linux '' '/var')/run
1504 - --sysconfdir="${EPREFIX%/}"/etc/ssh
1505 - --libexecdir="${EPREFIX%/}"/usr/$(get_libdir)/misc
1506 - --datadir="${EPREFIX%/}"/usr/share/openssh
1507 - --with-privsep-path="${EPREFIX%/}"/var/empty
1508 - --with-privsep-user=sshd
1509 - $(use_with audit audit linux)
1510 - $(use_with kerberos kerberos5 "${EPREFIX%/}"/usr)
1511 - # We apply the ldap and sctp patch conditionally, so can't pass --without-{ldap,sctp}
1512 - # unconditionally else we get unknown flag warnings.
1513 - $(use ldap && use_with ldap)
1514 - $(use sctp && use_with sctp)
1515 - $(use_with ldns)
1516 - $(use_with libedit)
1517 - $(use_with pam)
1518 - $(use_with pie)
1519 - $(use_with selinux)
1520 - $(use_with skey)
1521 - $(use_with ssl openssl)
1522 - $(use_with ssl md5-passwords)
1523 - $(use_with ssl ssl-engine)
1524 - )
1525 -
1526 - # The seccomp sandbox is broken on x32, so use the older method for now. #553748
1527 - use amd64 && [[ ${ABI} == "x32" ]] && myconf+=( --with-sandbox=rlimit )
1528 -
1529 - econf "${myconf[@]}"
1530 -}
1531 -
1532 -src_test() {
1533 - local t skipped=() failed=() passed=()
1534 - local tests=( interop-tests compat-tests )
1535 -
1536 - local shell=$(egetshell "${UID}")
1537 - if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
1538 - elog "Running the full OpenSSH testsuite requires a usable shell for the 'portage'"
1539 - elog "user, so we will run a subset only."
1540 - skipped+=( tests )
1541 - else
1542 - tests+=( tests )
1543 - fi
1544 -
1545 - # It will also attempt to write to the homedir .ssh.
1546 - local sshhome=${T}/homedir
1547 - mkdir -p "${sshhome}"/.ssh
1548 - for t in "${tests[@]}" ; do
1549 - # Some tests read from stdin ...
1550 - HOMEDIR="${sshhome}" HOME="${sshhome}" \
1551 - emake -k -j1 ${t} </dev/null \
1552 - && passed+=( "${t}" ) \
1553 - || failed+=( "${t}" )
1554 - done
1555 -
1556 - einfo "Passed tests: ${passed[*]}"
1557 - [[ ${#skipped[@]} -gt 0 ]] && ewarn "Skipped tests: ${skipped[*]}"
1558 - [[ ${#failed[@]} -gt 0 ]] && die "Some tests failed: ${failed[*]}"
1559 -}
1560 -
1561 -src_install() {
1562 - emake install-nokeys DESTDIR="${D}"
1563 - fperms 600 /etc/ssh/sshd_config
1564 - dobin contrib/ssh-copy-id
1565 - newinitd "${FILESDIR}"/sshd.rc6.5 sshd
1566 - newconfd "${FILESDIR}"/sshd-r1.confd sshd
1567 -
1568 - newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
1569 - if use pam ; then
1570 - sed -i \
1571 - -e "/^#UsePAM /s:.*:UsePAM yes:" \
1572 - -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
1573 - -e "/^#PrintMotd /s:.*:PrintMotd no:" \
1574 - -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
1575 - "${ED%/}"/etc/ssh/sshd_config || die
1576 - fi
1577 -
1578 - # Gentoo tweaks to default config files
1579 - cat <<-EOF >> "${ED%/}"/etc/ssh/sshd_config
1580 -
1581 - # Allow client to pass locale environment variables #367017
1582 - AcceptEnv LANG LC_*
1583 - EOF
1584 - cat <<-EOF >> "${ED%/}"/etc/ssh/ssh_config
1585 -
1586 - # Send locale environment variables #367017
1587 - SendEnv LANG LC_*
1588 - EOF
1589 -
1590 - if use livecd ; then
1591 - sed -i \
1592 - -e '/^#PermitRootLogin/c# Allow root login with password on livecds.\nPermitRootLogin Yes' \
1593 - "${ED%/}"/etc/ssh/sshd_config || die
1594 - fi
1595 -
1596 - if use ldap && [[ -n ${LDAP_PATCH} ]] ; then
1597 - insinto /etc/openldap/schema/
1598 - newins openssh-lpk_openldap.schema openssh-lpk.schema
1599 - fi
1600 -
1601 - doman contrib/ssh-copy-id.1
1602 - dodoc CREDITS OVERVIEW README* TODO sshd_config
1603 - use hpn && dodoc HPN-README
1604 - use X509 || dodoc ChangeLog
1605 -
1606 - diropts -m 0700
1607 - dodir /etc/skel/.ssh
1608 -
1609 - keepdir /var/empty
1610 -
1611 - systemd_dounit "${FILESDIR}"/sshd.{service,socket}
1612 - systemd_newunit "${FILESDIR}"/sshd_at.service 'sshd@.service'
1613 -}
1614 -
1615 -pkg_preinst() {
1616 - enewgroup sshd 22
1617 - enewuser sshd 22 -1 /var/empty sshd
1618 -}
1619 -
1620 -pkg_postinst() {
1621 - if has_version "<${CATEGORY}/${PN}-5.8_p1" ; then
1622 - elog "Starting with openssh-5.8p1, the server will default to a newer key"
1623 - elog "algorithm (ECDSA). You are encouraged to manually update your stored"
1624 - elog "keys list as servers update theirs. See ssh-keyscan(1) for more info."
1625 - fi
1626 - if has_version "<${CATEGORY}/${PN}-7.0_p1" ; then
1627 - elog "Starting with openssh-6.7, support for USE=tcpd has been dropped by upstream."
1628 - elog "Make sure to update any configs that you might have. Note that xinetd might"
1629 - elog "be an alternative for you as it supports USE=tcpd."
1630 - fi
1631 - if has_version "<${CATEGORY}/${PN}-7.1_p1" ; then #557388 #555518
1632 - elog "Starting with openssh-7.0, support for ssh-dss keys were disabled due to their"
1633 - elog "weak sizes. If you rely on these key types, you can re-enable the key types by"
1634 - elog "adding to your sshd_config or ~/.ssh/config files:"
1635 - elog " PubkeyAcceptedKeyTypes=+ssh-dss"
1636 - elog "You should however generate new keys using rsa or ed25519."
1637 -
1638 - elog "Starting with openssh-7.0, the default for PermitRootLogin changed from 'yes'"
1639 - elog "to 'prohibit-password'. That means password auth for root users no longer works"
1640 - elog "out of the box. If you need this, please update your sshd_config explicitly."
1641 - fi
1642 - if has_version "<${CATEGORY}/${PN}-7.6_p1" ; then
1643 - elog "Starting with openssh-7.6p1, openssh upstream has removed ssh1 support entirely."
1644 - elog "Furthermore, rsa keys with less than 1024 bits will be refused."
1645 - fi
1646 - if ! use ssl && has_version "${CATEGORY}/${PN}[ssl]" ; then
1647 - elog "Be aware that by disabling openssl support in openssh, the server and clients"
1648 - elog "no longer support dss/rsa/ecdsa keys. You will need to generate ed25519 keys"
1649 - elog "and update all clients/servers that utilize them."
1650 - fi
1651 -
1652 - if use hpn && [[ -n "${HPN_DISABLE_MTAES}" ]] ; then
1653 - elog ""
1654 - elog "HPN's multi-threaded AES CTR cipher is currently known to be broken"
1655 - elog "and therefore disabled at runtime per default."
1656 - elog "Make sure your sshd_config is up to date and contains"
1657 - elog ""
1658 - elog " DisableMTAES yes"
1659 - elog ""
1660 - elog "Otherwise you maybe unable to connect to this sshd using any AES CTR cipher."
1661 - elog ""
1662 - fi
1663 -}