summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-04-30 22:47:40 +0000
committerMike Frysinger <vapier@gentoo.org>2012-04-30 22:47:40 +0000
commit40fd83df3eec59b300993dca0114678124df33ed (patch)
tree3f63efac4372c5228d9ec4ff24ec06ebc949b1c7 /net-misc/openssh
parentVersion bump. Import of Enrico Tagliavini's ebuild from the x11 overlay. (diff)
downloadhistorical-40fd83df3eec59b300993dca0114678124df33ed.tar.gz
historical-40fd83df3eec59b300993dca0114678124df33ed.tar.bz2
historical-40fd83df3eec59b300993dca0114678124df33ed.zip
Version bump with work from Robin #414071 by Michael Weber.
Package-Manager: portage-2.2.0_alpha100/cvs/Linux x86_64
Diffstat (limited to 'net-misc/openssh')
-rw-r--r--net-misc/openssh/ChangeLog10
-rw-r--r--net-misc/openssh/Manifest26
-rw-r--r--net-misc/openssh/files/openssh-6.0_p1-hpn-progressmeter.patch15
-rw-r--r--net-misc/openssh/files/openssh-6.0_p1-x509-glue.patch15
-rw-r--r--net-misc/openssh/files/openssh-6.0_p1-x509-hpn-glue.patch57
-rw-r--r--net-misc/openssh/openssh-6.0_p1.ebuild280
6 files changed, 398 insertions, 5 deletions
diff --git a/net-misc/openssh/ChangeLog b/net-misc/openssh/ChangeLog
index b42d01666269..fc48d99f6d68 100644
--- a/net-misc/openssh/ChangeLog
+++ b/net-misc/openssh/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for net-misc/openssh
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/ChangeLog,v 1.440 2012/04/16 20:48:30 maekke Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/ChangeLog,v 1.441 2012/04/30 22:47:40 vapier Exp $
+
+*openssh-6.0_p1 (30 Apr 2012)
+
+ 30 Apr 2012; Mike Frysinger <vapier@gentoo.org>
+ +files/openssh-6.0_p1-hpn-progressmeter.patch,
+ +files/openssh-6.0_p1-x509-glue.patch,
+ +files/openssh-6.0_p1-x509-hpn-glue.patch, +openssh-6.0_p1.ebuild:
+ Version bump with work from Robin #414071 by Michael Weber.
16 Apr 2012; Markus Meier <maekke@gentoo.org> openssh-5.9_p1-r4.ebuild:
arm stable, bug #396075
diff --git a/net-misc/openssh/Manifest b/net-misc/openssh/Manifest
index 944ef7ec33b2..02e0dada27bc 100644
--- a/net-misc/openssh/Manifest
+++ b/net-misc/openssh/Manifest
@@ -15,6 +15,9 @@ AUX openssh-5.8_p1-x509-hpn-glue.patch 1907 RMD160 954bfc141bf780e0c36712ee2f0f2
AUX openssh-5.9_p1-drop-openssl-check.patch 848 RMD160 91bf95bcd7ea9f4b669e713bba730cdbdce5dd6f SHA1 41795fc9759e54d4de9d8d4bc8b336ada9a92d43 SHA256 89b011e27548b9922deed63ed57a6c94ea8013bb3bfb4d6590ba43d284a2ab86
AUX openssh-5.9_p1-sshd-gssapi-multihomed.patch 6622 RMD160 abde3019aab3c94995ffe5574dc27d250b22af82 SHA1 0c825c0ea5f37836bd6206f59953dab751f3371b SHA256 f5ae8419023d9e5f64c4273e43d60664d0079b5888ed999496038f295852e0ae
AUX openssh-5.9_p1-x509-glue.patch 569 RMD160 d23083a8e9c83587adbf22f82bedfc2714232039 SHA1 9b80ade665db278459b063097593999f518606e0 SHA256 579ef6409878cea36828057a82a37232ba230af0acb58438f020c284f06a6510
+AUX openssh-6.0_p1-hpn-progressmeter.patch 379 RMD160 5e77c4031326013543e8278efc696f24a1cf7203 SHA1 63a3dd4ce10970c27c0227d03f3c12e2dad4cd5f SHA256 fb38d9d16132fcc16fb2648bce21e2260fb5cadf0ae2e2a7849638aeb79d3dc7
+AUX openssh-6.0_p1-x509-glue.patch 569 RMD160 4ed2f74ed9e158fc9d9529abe1dc6b68981a1f1e SHA1 196bda7bd786a3d9f06bc332d14122e0b8322299 SHA256 8c9048a33036a93f56e254cfd53b18313682d466deadfdcd8937a46793617900
+AUX openssh-6.0_p1-x509-hpn-glue.patch 1774 RMD160 20cb84d6ef0f342ff8d7ab7df56a7d61f0906d83 SHA1 ca9ca97ab247081a8b80a09e085db75ff36be02e SHA256 b2dcff21652eea92d2ff2640a568070a944e7bfb2bd3217c433e6383a64b0970
AUX sshd.confd 396 RMD160 029680b2281961130a815ef599750c4fc4e84987 SHA1 23c283d0967944b6125be26ed4628f49abf586b2 SHA256 29c6d57ac3ec6018cadc6ba6cd9b90c9ed46e20049b970fdcc68ee2481a2ee41
AUX sshd.pam 294 RMD160 1d4499a7de54188e51e87a240ec7a1b3b1af583d SHA1 4cd17fb40793fa9ca77ac93698129f2c8cafd7b8 SHA256 f01cc51c624b21a815fb6c0be35edc590e2e6f8a5ffbdcabc220a9630517972f
AUX sshd.pam_include.2 156 RMD160 c4f6ba6e3a705eef63e571189e28de71e7d61178 SHA1 1223f7a43a5e124521d48852b2d23bb8ba0a788f SHA256 166136e27d653e0bf481a6ca79fecb7d9fa2fc3d597d041f97df595f65a8193c
@@ -43,11 +46,15 @@ DIST openssh-5.8p2.tar.gz 1115475 RMD160 f70cdb10983c389b1d6e52da522b9ff8256f1af
DIST openssh-5.9p1+x509-7.0.diff.gz 181263 RMD160 edc39eacc815909358a9abfee738ba0367225b4d SHA1 c78ed1f80412aef7b657cae490b0ac0099914105 SHA256 a28e2535ecbf95deeef682682e7551459cc494bbc1c4ccb89be93cfe826d76ca
DIST openssh-5.9p1-hpn13v11.diff.gz 21971 RMD160 d22bbdcc48efb4ce0e0cc37bb7d8ff4705806f34 SHA1 3dbacf253bcbc631db7ca5eaf35cbbc8a1f3f2c3 SHA256 6a47a9e57f87385cac9a380b0b1649b73532afaf40c15f62e9236427c84e7aae
DIST openssh-5.9p1.tar.gz 1110014 RMD160 12d92321a2b9f404641a9cdada738784eb30e1cd SHA1 ac4e0055421e9543f0af5da607a72cf5922dcc56 SHA256 8d3e8b6b6ff04b525a6dfa6fdeb6a99043ccf6c3310cc32eba84c939b07777d5
+DIST openssh-6.0p1+x509-7.1.diff.gz 200986 RMD160 7aa0550460ccd17a008b5e6b74077873328b4cad SHA1 59aaceac1ca83e1c070d641aa95a51873f9b65e5 SHA256 c11e3837704a24393353fe264d61ffea8c1f23c0cb5b8261866c25677930768b
+DIST openssh-6.0p1-hpn13v12.diff.gz 20223 RMD160 722ba7c8572fab1d18e7547e65da0b0e1fd2035a SHA1 19d9ee9836b7611bc03e0f7c70f71cea30a53d49 SHA256 b6158c10fac153dd2a9f5d9b29df1e4db17a91f84f100b99526655317d9bf4c0
+DIST openssh-6.0p1.tar.gz 1126034 RMD160 afad16fac6500da5cdfad94e5b3cac8c68223374 SHA1 f691e53ef83417031a2854b8b1b661c9c08e4422 SHA256 589d48e952d6c017e667873486b5df63222f9133d417d0002bd6429d9bd882de
DIST openssh-lpk-5.4p1-0.3.13.patch.gz 18105 RMD160 734b2c3ea740b6de610e3bfa91c93a2540b79acc SHA1 4c73f21b16db41c16e096db834380ec53f15c723 SHA256 4e5dbe769e487c914ecc5b104866f6d4412cbe35c3f2bed897d06f7d824878be
DIST openssh-lpk-5.6p1-0.3.13.patch.gz 18376 RMD160 c928a22d890de17c43ac8a71ac0a551fbe38a831 SHA1 477ef82043278ba9e314e14e7a487f1541fbc48b SHA256 42a76b67c390c3ed28efd6e1734ca5a7edfefc635c35086dbd610999130678e9
DIST openssh-lpk-5.7p1-0.3.13.patch.gz 18392 RMD160 9ca299e2c05c97528ecbea5cc30fe604904daa2c SHA1 5581a12eee5d5e739b77927ce7ddb00625ab03c4 SHA256 739fa32e267f2c30362bb953d597bcbb55b58d76e13f644004fa63ded81522f7
DIST openssh-lpk-5.8p2-0.3.14.patch.gz 18656 RMD160 ca008e5c8c1f43be334f6e4e598d79d0153e94e5 SHA1 9eab90211363e6ea74e250d072cf14b69516bc0e SHA256 adac5e13a4918e14e4d349f4360d9c740ae6f69de4e64520e8d51e8d39f969ad
DIST openssh-lpk-5.9p1-0.3.14.patch.gz 18335 RMD160 74f4f501be1a3525d4b176e20a9905966c9b1bde SHA1 eca403eece5fba829c0e5e6045315f583333deec SHA256 1a922d57a2e7020bf597135437a57080d7d046c9f41a7a53559945ddddbe0892
+DIST openssh-lpk-6.0p1-0.3.14.patch.gz 18401 RMD160 220116e6408f6cde7594771aeb338ba8c8e83a3f SHA1 281ba5824cced31533587df5d9ec84cb7313780b SHA256 d0f3d55fd92ecc45aa6120d6ea919c903e4828ce0c2b07612c742a2aa7648beb
EBUILD openssh-5.5_p1-r2.ebuild 8625 RMD160 91d2b537387b65c52c09d4345af55634026ecde3 SHA1 fc76825722f7efc00dc8845537dc9600a50aed28 SHA256 0d5647080f73bbfbac007737371b62597872a537c96962ad1c65daffa1358071
EBUILD openssh-5.6_p1-r2.ebuild 8370 RMD160 5028b08505d92258fe34d179dd810eeca0cee0e1 SHA1 2a0306c02af7e974cb63cb518466d03fc2a56c8e SHA256 c60aaa079a8b1e6e09d58f9a1e87a5cb2139c7c9f9ba329c9184fcae08d7be9c
EBUILD openssh-5.7_p1-r1.ebuild 8219 RMD160 4364570cacb70eb79c2b76330da8a82ec05838e1 SHA1 2655eaac1cf94c6d30d29afd6ffbc37c1454c9cd SHA256 6d17db916afc15922fb8970f7a2991931d70891d9cc93d964eb9a8d5a330ab37
@@ -56,12 +63,23 @@ EBUILD openssh-5.8_p2-r1.ebuild 8467 RMD160 3887a4bf87097ddaa80d18701a6d27e6e692
EBUILD openssh-5.8_p2.ebuild 8464 RMD160 8036e8bcc34868d933302565975631e4cf6f4ec4 SHA1 e26d53caf98b83be97f7652a9bbe5948923da7b4 SHA256 9a55dd7bbc043dc82a1af9e2e3f0901b52d19f6180620a1f6c89aad66fdad46f
EBUILD openssh-5.9_p1-r3.ebuild 9136 RMD160 c9f0ba7b59e0002b599bea39f79228d5f2d4f1a9 SHA1 4cbf1cdaab1b2d804fca433551880b97f1a28c70 SHA256 56804ba2c893a633eea59405f1f9632bb2cd5da0c2b21b90c96364b79cb86ff9
EBUILD openssh-5.9_p1-r4.ebuild 9187 RMD160 07e04a1c4e97643ad072d6494d6f9d30134e2e8f SHA1 4277d03395015d73f4b13e1d4c066369735a29c9 SHA256 222a505bcd1f3441fbe23c7c52e3f9cb034eb0632844f26cb0b7384840e65496
-MISC ChangeLog 69813 RMD160 6441b91f4cdc0940a1010e4fbf2955b1d7c8d622 SHA1 464bbfc25a6ac1469d5c7aaedf100ff534202946 SHA256 617665a27b3883f0e5a80315b0b978a061f0b44e0a12b0bcccd3f355fe1c1974
+EBUILD openssh-6.0_p1.ebuild 9033 RMD160 2e0931ab0b3e850749d64ff8f25281bfa85ea20e SHA1 a5ffd832451f5254b7f1769b837ea86d08554c50 SHA256 9b73c786a5223cd893eae4754a6e953ad7578b195e7764b4e3283dc651cca275
+MISC ChangeLog 70116 RMD160 6facc249397b88145266635ed59ce969efa85634 SHA1 90812fbea858b4bc3fafd8b69931acf9caa5699f SHA256 d54ad532d7332cac6a325763398ac37fe3ba8325cde1c98afe67d664cd672374
MISC metadata.xml 1599 RMD160 31fdd1531a4111aa437882680029451b29ddf4aa SHA1 af53a6887ebf563150184ab40b4cc018ab4e4d3f SHA256 fddc51b98b6831f5bc0f1f5fdeb78c064f9c40fc5c9a9f31ec816890e6aade86
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
-iEYEARECAAYFAk+MhkoACgkQkKaRLQcq0GIg8gCfVY8+2HwWzUJPwoTHpgwDT/8y
-aJsAn1a0oUR0ylhR8O4vhzRA8UJkT4y1
-=CAn9
+iQIcBAEBAgAGBQJPnxayAAoJELEHsLL7fEFWoOMP/jCbcJ9dpG5VIdqdsYjAysVz
+W05WLx6xoxHQhNfRaDI8beI0GIgnTDcucwow9v8gq5ykT5KaV1yXvzSVz5tDRFnG
+/p7q0znkIw8EwLrHV9WDhvy70ZN5KjIZVTCUjRPPc0pEe9q2e+IG43IAqp9uW+IN
+IrFvFdYQgAN06q6Mv8UK9GJRZAHACZXSbtGbewRoWRlDG4pureheUmthJetWYlJl
+kWr1WOdtpIsomwNlog4207CIzmKy9ZdVAnNyrf9hlRtkROIpdqnzXfvFUH3sw3Jg
+VWD1Exn3JCfaF66DQT5qsbvetz/0ZCsn86b4iKDIrEGVSpXd74g6P+Pt3t533e7D
+7vmvbvt1pm0jN5fWXBZjfFk9BKiCMlQYHvsatYZEDvV4ThmlGTQ0Ns5/ghr/+l8a
+NCeJ8QICoutg3YVtJzrTOtILJ2cFN+9aNtIIKCCDtYP2z27D9mJe/vijXaAH0zya
+O7jDY/Nj/h4PJuI6tqeByHQU6zGvrBg7k6LYhhTGcUCCYETvT0VRWSIoA8WaMtzZ
+IizC0BdCxSUYHHSZl4rOFgSUhP4QssvlAA9QVUZF0CaOuJxv+wD9aF43kGRMxEUk
+53iAl/k0mDumSMimPi2KDi5dbfHhvWr8IOGGcdaWy7cEvHLiUNFK8uQ/+J7YM+18
+Zo7dXPkFDMVpIuSp1GZ9
+=4ifS
-----END PGP SIGNATURE-----
diff --git a/net-misc/openssh/files/openssh-6.0_p1-hpn-progressmeter.patch b/net-misc/openssh/files/openssh-6.0_p1-hpn-progressmeter.patch
new file mode 100644
index 000000000000..56805d12a9b7
--- /dev/null
+++ b/net-misc/openssh/files/openssh-6.0_p1-hpn-progressmeter.patch
@@ -0,0 +1,15 @@
+don't go reading random stack values
+
+already e-mailed to upstream hpn devs
+
+--- progressmeter.c
++++ progressmeter.c
+@@ -183,7 +183,7 @@
+ percent = ((float)cur_pos / end_pos) * 100;
+ else
+ percent = 100;
+- snprintf(buf + strlen(buf), win_size - strlen(buf-8),
++ snprintf(buf + strlen(buf), win_size - strlen(buf) - 8,
+ " %3d%% ", percent);
+
+ /* amount transferred */
diff --git a/net-misc/openssh/files/openssh-6.0_p1-x509-glue.patch b/net-misc/openssh/files/openssh-6.0_p1-x509-glue.patch
new file mode 100644
index 000000000000..3633a2af60be
--- /dev/null
+++ b/net-misc/openssh/files/openssh-6.0_p1-x509-glue.patch
@@ -0,0 +1,15 @@
+make x509 apply after openssh-5.9_p1-sshd-gssapi-multihomed.patch
+
+--- openssh-6.0p1+x509-7.1.diff
++++ openssh-6.0p1+x509-7.1.diff
+@@ -13502,9 +13502,9 @@
+ Specifies whether challenge-response authentication is allowed (e.g. via
+ PAM or though authentication styles supported in
+ @@ -430,6 +507,16 @@
++ This facility is provided to assist with operation on multi homed machines.
+ The default is
+ .Dq yes .
+- Note that this option applies to protocol version 2 only.
+ +.It Cm HostbasedAlgorithms
+ +Specifies the protocol version 2 algorithms used in
+ +.Dq hostbased
diff --git a/net-misc/openssh/files/openssh-6.0_p1-x509-hpn-glue.patch b/net-misc/openssh/files/openssh-6.0_p1-x509-hpn-glue.patch
new file mode 100644
index 000000000000..9e3dfdbe3e6b
--- /dev/null
+++ b/net-misc/openssh/files/openssh-6.0_p1-x509-hpn-glue.patch
@@ -0,0 +1,57 @@
+diff --git a/Makefile.in b/Makefile.in
+index ecb45cd..7834fb1 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -45,12 +45,13 @@ FIPSLD_CC=@FIPSLD_CC@
+ CC=@CC@
+ LD=@LD@
+ CFLAGS=@CFLAGS@
+-CPPFLAGS=-I. -I$(srcdir) @CPPFLAGS@ @LDAP_CPPFLAGS@ $(PATHS) @DEFS@
++CPPFLAGS=-I. -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@
+ LIBS=@LIBS@
+ SSHLIBS=@SSHLIBS@
+ SSHDLIBS=@SSHDLIBS@
+ LIBEDIT=@LIBEDIT@
+ LIBLDAP=@LDAP_LDFLAGS@ @LDAP_LIBS@
++CPPFLAGS+=@LDAP_CPPFLAGS@
+ AR=@AR@
+ AWK=@AWK@
+ RANLIB=@RANLIB@
+diff --git a/sshconnect.c b/sshconnect.c
+index 19a2b06..dd75f78 100644
+--- a/sshconnect.c
++++ b/sshconnect.c
+@@ -580,7 +580,7 @@ ssh_exchange_identification(int timeout_ms)
+ snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s%s",
+ compat20 ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1,
+ compat20 ? PROTOCOL_MINOR_2 : minor1,
+- SSH_VERSION, compat20 ? " PKIX\r\n" : "\n");
++ SSH_VERSION, compat20 ? "\r\n" : "\n");
+ if (roaming_atomicio(vwrite, connection_out, buf, strlen(buf))
+ != strlen(buf))
+ fatal("write: %.100s", strerror(errno));
+diff --git a/sshd.c b/sshd.c
+index a5c437d..a1105a0 100644
+--- a/sshd.c
++++ b/sshd.c
+@@ -428,8 +428,8 @@ sshd_exchange_identification(int sock_in, int sock_out)
+ minor = PROTOCOL_MINOR_1;
+ comment = "";
+ }
+- snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s%s%s", major, minor,
+- SSH_VERSION, comment, newline);
++ snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s%s", major, minor,
++ SSH_VERSION, newline);
+ server_version_string = xstrdup(buf);
+
+ /* Send our protocol version identification. */
+diff --git a/version.h b/version.h
+index 78983d9..ec1746d 100644
+--- a/version.h
++++ b/version.h
+@@ -3,4 +3,5 @@
+ #define SSH_VERSION "OpenSSH_6.0"
+
+ #define SSH_PORTABLE "p1"
++#define SSH_X509 " PKIX"
+ #define SSH_RELEASE SSH_VERSION SSH_PORTABLE
diff --git a/net-misc/openssh/openssh-6.0_p1.ebuild b/net-misc/openssh/openssh-6.0_p1.ebuild
new file mode 100644
index 000000000000..58630932e284
--- /dev/null
+++ b/net-misc/openssh/openssh-6.0_p1.ebuild
@@ -0,0 +1,280 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/openssh-6.0_p1.ebuild,v 1.1 2012/04/30 22:47:40 vapier Exp $
+
+EAPI="2"
+inherit eutils flag-o-matic multilib autotools pam systemd
+
+# Make it more portable between straight releases
+# and _p? releases.
+PARCH=${P/_}
+
+HPN_PATCH="${PARCH}-hpn13v12.diff.gz"
+LDAP_PATCH="${PARCH/-/-lpk-}-0.3.14.patch.gz"
+X509_VER="7.1" X509_PATCH="${PARCH}+x509-${X509_VER}.diff.gz"
+
+DESCRIPTION="Port of OpenBSD's free SSH release"
+HOMEPAGE="http://www.openssh.org/"
+SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
+ ${HPN_PATCH:+hpn? ( http://www.psc.edu/networking/projects/hpn-ssh/${HPN_PATCH} mirror://gentoo/${HPN_PATCH} )}
+ ${LDAP_PATCH:+ldap? ( mirror://gentoo/${LDAP_PATCH} )}
+ ${X509_PATCH:+X509? ( http://roumenpetrov.info/openssh/x509-${X509_VER}/${X509_PATCH} )}
+ "
+
+LICENSE="as-is"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="${HPN_PATCH:++}hpn kerberos ldap libedit pam selinux skey static tcpd X X509"
+
+RDEPEND="pam? ( virtual/pam )
+ kerberos? ( virtual/krb5 )
+ selinux? ( >=sys-libs/libselinux-1.28 )
+ skey? ( >=sys-auth/skey-1.1.5-r1 )
+ ldap? ( net-nds/openldap )
+ libedit? ( dev-libs/libedit )
+ >=dev-libs/openssl-0.9.6d
+ >=sys-libs/zlib-1.2.3
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
+ X? ( x11-apps/xauth )
+ userland_GNU? ( virtual/shadow )"
+DEPEND="${RDEPEND}
+ dev-util/pkgconfig
+ virtual/os-headers
+ sys-devel/autoconf"
+RDEPEND="${RDEPEND}
+ pam? ( >=sys-auth/pambase-20081028 )"
+
+S=${WORKDIR}/${PARCH}
+
+pkg_setup() {
+ # this sucks, but i'd rather have people unable to `emerge -u openssh`
+ # than not be able to log in to their server any more
+ maybe_fail() { [[ -z ${!2} ]] && echo ${1} ; }
+ local fail="
+ $(use X509 && maybe_fail X509 X509_PATCH)
+ $(use ldap && maybe_fail ldap LDAP_PATCH)
+ $(use hpn && maybe_fail hpn HPN_PATCH)
+ "
+ fail=$(echo ${fail})
+ if [[ -n ${fail} ]] ; then
+ eerror "Sorry, but this version does not yet support features"
+ eerror "that you requested: ${fail}"
+ eerror "Please mask ${PF} for now and check back later:"
+ eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
+ die "booooo"
+ fi
+}
+
+save_version() {
+ # version.h patch conflict avoidence
+ mv version.h version.h.$1
+ cp -f version.h.pristine version.h
+}
+
+src_prepare() {
+ sed -i \
+ -e '/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:/usr/bin/xauth:' \
+ pathnames.h || die
+ # keep this as we need it to avoid the conflict between LPK and HPN changing
+ # this file.
+ cp version.h version.h.pristine
+
+ # don't break .ssh/authorized_keys2 for fun
+ sed -i '/^AuthorizedKeysFile/s:^:#:' sshd_config || die
+
+ epatch "${FILESDIR}"/${PN}-5.9_p1-sshd-gssapi-multihomed.patch #378361
+ if use X509 ; then
+ pushd .. >/dev/null
+ epatch "${FILESDIR}"/${PN}-6.0_p1-x509-glue.patch
+ popd >/dev/null
+ epatch "${WORKDIR}"/${X509_PATCH%.*}
+ epatch "${FILESDIR}"/${PN}-6.0_p1-x509-hpn-glue.patch
+ save_version X509
+ fi
+ if ! use X509 ; then
+ if [[ -n ${LDAP_PATCH} ]] && use ldap ; then
+ epatch "${WORKDIR}"/${LDAP_PATCH%.*}
+ save_version LPK
+ fi
+ else
+ use ldap && ewarn "Sorry, X509 and LDAP conflict internally, disabling LDAP"
+ fi
+ epatch "${FILESDIR}"/${PN}-4.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
+ if [[ -n ${HPN_PATCH} ]] && use hpn; then
+ epatch "${WORKDIR}"/${HPN_PATCH%.*}
+ epatch "${FILESDIR}"/${PN}-6.0_p1-hpn-progressmeter.patch
+ save_version HPN
+ # The AES-CTR multithreaded variant is broken, and causes random hangs
+ # when combined background threading and control sockets. To avoid
+ # this, we change the internal table to use the non-multithread version
+ # for the meantime. Do NOT remove this in new versions. See bug #354113
+ # comment #6 for testcase.
+ # Upstream reference: http://www.psc.edu/networking/projects/hpn-ssh/
+ ## Additionally, the MT-AES-CTR mode cipher replaces the default ST-AES-CTR mode
+ ## cipher. Be aware that if the client process is forked using the -f command line
+ ## option the process will hang as the parent thread gets 'divorced' from the key
+ ## generation threads. This issue will be resolved as soon as possible
+ sed -i \
+ -e '/aes...-ctr.*SSH_CIPHER_SSH2/s,evp_aes_ctr_mt,evp_aes_128_ctr,' \
+ cipher.c || die
+ fi
+
+ sed -i "s:-lcrypto:$(pkg-config --libs openssl):" configure{,.ac} || die
+
+ # Disable PATH reset, trust what portage gives us. bug 254615
+ sed -i -e 's:^PATH=/:#PATH=/:' configure || die
+
+ # Now we can build a sane merged version.h
+ (
+ sed '/^#define SSH_RELEASE/d' version.h.* | sort -u
+ macros=()
+ for p in HPN LPK X509 ; do [ -e version.h.${p} ] && macros+=( SSH_${p} ) ; done
+ printf '#define SSH_RELEASE SSH_VERSION SSH_PORTABLE %s\n' "${macros}"
+ ) > version.h
+
+ eautoreconf
+}
+
+static_use_with() {
+ local flag=$1
+ if use static && use ${flag} ; then
+ ewarn "Disabling '${flag}' support because of USE='static'"
+ # rebuild args so that we invert the first one (USE flag)
+ # but otherwise leave everything else working so we can
+ # just leverage use_with
+ shift
+ [[ -z $1 ]] && flag="${flag} ${flag}"
+ set -- !${flag} "$@"
+ fi
+ use_with "$@"
+}
+
+src_configure() {
+ addwrite /dev/ptmx
+ addpredict /etc/skey/skeykeys #skey configure code triggers this
+
+ use static && append-ldflags -static
+
+ econf \
+ --with-ldflags="${LDFLAGS}" \
+ --disable-strip \
+ --sysconfdir=/etc/ssh \
+ --libexecdir=/usr/$(get_libdir)/misc \
+ --datadir=/usr/share/openssh \
+ --with-privsep-path=/var/empty \
+ --with-privsep-user=sshd \
+ --with-md5-passwords \
+ --with-ssl-engine \
+ $(static_use_with pam) \
+ $(static_use_with kerberos kerberos5 /usr) \
+ ${LDAP_PATCH:+$(use X509 || ( use ldap && use_with ldap ))} \
+ $(use_with libedit) \
+ $(use_with selinux) \
+ $(use_with skey) \
+ $(use_with tcpd tcp-wrappers)
+}
+
+src_install() {
+ emake install-nokeys DESTDIR="${D}" || die
+ fperms 600 /etc/ssh/sshd_config
+ dobin contrib/ssh-copy-id || die
+ newinitd "${FILESDIR}"/sshd.rc6.3 sshd
+ newconfd "${FILESDIR}"/sshd.confd sshd
+ keepdir /var/empty
+
+ # not all openssl installs support ecc, or are functional #352645
+ if ! grep -q '#define OPENSSL_HAS_ECC 1' config.h ; then
+ elog "dev-libs/openssl was built with 'bindist' - disabling ecdsa support"
+ dosed 's:&& gen_key ecdsa::' /etc/init.d/sshd || die
+ fi
+
+ newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
+ if use pam ; then
+ sed -i \
+ -e "/^#UsePAM /s:.*:UsePAM yes:" \
+ -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
+ -e "/^#PrintMotd /s:.*:PrintMotd no:" \
+ -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
+ "${D}"/etc/ssh/sshd_config || die "sed of configuration file failed"
+ fi
+
+ # This instruction is from the HPN webpage,
+ # Used for the server logging functionality
+ if [[ -n ${HPN_PATCH} ]] && use hpn ; then
+ keepdir /var/empty/dev
+ fi
+
+ if use ldap ; then
+ insinto /etc/openldap/schema/
+ newins openssh-lpk_openldap.schema openssh-lpk.schema
+ fi
+
+ doman contrib/ssh-copy-id.1
+ dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
+
+ diropts -m 0700
+ dodir /etc/skel/.ssh
+
+ systemd_dounit "${FILESDIR}"/sshd.{service,socket} || die
+ systemd_newunit "${FILESDIR}"/sshd_at.service 'sshd@.service' || die
+}
+
+src_test() {
+ local t tests skipped failed passed shell
+ tests="interop-tests compat-tests"
+ skipped=""
+ shell=$(egetshell ${UID})
+ if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
+ elog "Running the full OpenSSH testsuite"
+ elog "requires a usable shell for the 'portage'"
+ elog "user, so we will run a subset only."
+ skipped="${skipped} tests"
+ else
+ tests="${tests} tests"
+ fi
+ # It will also attempt to write to the homedir .ssh
+ local sshhome=${T}/homedir
+ mkdir -p "${sshhome}"/.ssh
+ for t in ${tests} ; do
+ # Some tests read from stdin ...
+ HOMEDIR="${sshhome}" \
+ emake -k -j1 ${t} </dev/null \
+ && passed="${passed}${t} " \
+ || failed="${failed}${t} "
+ done
+ einfo "Passed tests: ${passed}"
+ ewarn "Skipped tests: ${skipped}"
+ if [[ -n ${failed} ]] ; then
+ ewarn "Failed tests: ${failed}"
+ die "Some tests failed: ${failed}"
+ else
+ einfo "Failed tests: ${failed}"
+ return 0
+ fi
+}
+
+pkg_preinst() {
+ enewgroup sshd 22
+ enewuser sshd 22 -1 /var/empty sshd
+}
+
+pkg_postinst() {
+ elog "Starting with openssh-5.8p1, the server will default to a newer key"
+ elog "algorithm (ECDSA). You are encouraged to manually update your stored"
+ elog "keys list as servers update theirs. See ssh-keyscan(1) for more info."
+ echo
+ ewarn "Remember to merge your config files in /etc/ssh/ and then"
+ ewarn "reload sshd: '/etc/init.d/sshd reload'."
+ if use pam ; then
+ echo
+ ewarn "Please be aware users need a valid shell in /etc/passwd"
+ ewarn "in order to be allowed to login."
+ fi
+ # This instruction is from the HPN webpage,
+ # Used for the server logging functionality
+ if [[ -n ${HPN_PATCH} ]] && use hpn ; then
+ echo
+ einfo "For the HPN server logging patch, you must ensure that"
+ einfo "your syslog application also listens at /var/empty/dev/log."
+ fi
+}