diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-08-23 10:37:48 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-08-23 10:37:48 +0000 |
commit | 0b305e31ec1ce9d46bdb815b0636c3c11565f7a6 (patch) | |
tree | 5fa825a9c9a44039ea38bebe71e4148f28214129 /net-misc/openssh | |
parent | ppc stable #278864 (diff) | |
download | historical-0b305e31ec1ce9d46bdb815b0636c3c11565f7a6.tar.gz historical-0b305e31ec1ce9d46bdb815b0636c3c11565f7a6.tar.bz2 historical-0b305e31ec1ce9d46bdb815b0636c3c11565f7a6.zip |
Update x509 patch, update gsskex patch #279488 by Harald Barth, and update x509/hpn glue #270508 by BedOS_Gui.
Package-Manager: portage-2.2_rc38/cvs/Linux x86_64
Diffstat (limited to 'net-misc/openssh')
-rw-r--r-- | net-misc/openssh/ChangeLog | 10 | ||||
-rw-r--r-- | net-misc/openssh/Manifest | 15 | ||||
-rw-r--r-- | net-misc/openssh/files/openssh-5.2_p1-gsskex-fix.patch | 16 | ||||
-rw-r--r-- | net-misc/openssh/files/openssh-5.2_p1-x509-hpn-glue.patch | 91 | ||||
-rw-r--r-- | net-misc/openssh/openssh-5.2_p1-r3.ebuild | 255 |
5 files changed, 381 insertions, 6 deletions
diff --git a/net-misc/openssh/ChangeLog b/net-misc/openssh/ChangeLog index 02030c409fad..14754be93cce 100644 --- a/net-misc/openssh/ChangeLog +++ b/net-misc/openssh/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for net-misc/openssh # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/ChangeLog,v 1.357 2009/08/13 06:30:33 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/ChangeLog,v 1.358 2009/08/23 10:37:47 vapier Exp $ + +*openssh-5.2_p1-r3 (23 Aug 2009) + + 23 Aug 2009; Mike Frysinger <vapier@gentoo.org> +openssh-5.2_p1-r3.ebuild, + +files/openssh-5.2_p1-gsskex-fix.patch, + +files/openssh-5.2_p1-x509-hpn-glue.patch: + Update x509 patch, update gsskex patch #279488 by Harald Barth, and update + x509/hpn glue #270508 by BedOS_Gui. 13 Aug 2009; Mike Frysinger <vapier@gentoo.org> openssh-5.0_p1-r2.ebuild, openssh-5.1_p1-r2.ebuild, openssh-5.1_p1-r3.ebuild, diff --git a/net-misc/openssh/Manifest b/net-misc/openssh/Manifest index 8b68c8dca7f7..814a971bf98a 100644 --- a/net-misc/openssh/Manifest +++ b/net-misc/openssh/Manifest @@ -13,6 +13,8 @@ AUX openssh-5.1_p1-null-banner.patch 1411 RMD160 b3034cecc1d74973eed05c8f6ef580c AUX openssh-5.1_p1-x509-headers.patch 248 RMD160 e0085a315ac4a766527e4b44095f9520de79d7a5 SHA1 1d39aea309013ce81de4f03db569c838453176a3 SHA256 3d882e3c0701387c81b87aead5635d3d4c1962dbe78f3407cd6de73913c35824 AUX openssh-5.1_p1-x509-hpn-glue.patch 3373 RMD160 024d7f17972907a591a067bfd0883ba0c0b297d0 SHA1 1b2ad74448c695bedee22a48d0bca879605c23d0 SHA256 0d9b10881a9207e5feec7429693b34fa56464e2c9e4fea1540d258ee2000e37a AUX openssh-5.2_p1-autoconf.patch 386 RMD160 8e57ae97df0b2483f826a7aba00bc0622b9a28f8 SHA1 22c4e40f54f97f866b460fe8987eb16363410caf SHA256 42bb5f23f02241186abd6158ac15cd1fba0fadb4bd79e6b051fbd05605419ebb +AUX openssh-5.2_p1-gsskex-fix.patch 408 RMD160 6a6296cd1c8acc52af4e0d8b6238b326d5d41e77 SHA1 b31e5294c68e6af9a75987a1c3ece5e52f56e9a5 SHA256 8190db31ed2e8dc6ce79030e5c648d04610b06dd8366df5948ef6e990314ee96 +AUX openssh-5.2_p1-x509-hpn-glue.patch 2851 RMD160 2c3fbb549976f9004e89bcfb58dadf2186f64517 SHA1 ff666fb2a0ef3fc7d703f99438ca4c39ee2eafdf SHA256 a21336a892b61e29a556d16e9f0a67ee08ad04dd61e3963a201fdf032ce55f75 AUX openssh-5.2p1-ldap-stdargs.diff 252 RMD160 7bf89a0946446b43ce3026b7b01a9a4c637f388a SHA1 7b62038dc3060b1e77df213c85874ba80acd8f64 SHA256 97281375efa33e9ce70a55bfa95b6b426208175e7e3ff493012bc25d9b012f45 AUX sshd.confd 396 RMD160 029680b2281961130a815ef599750c4fc4e84987 SHA1 23c283d0967944b6125be26ed4628f49abf586b2 SHA256 29c6d57ac3ec6018cadc6ba6cd9b90c9ed46e20049b970fdcc68ee2481a2ee41 AUX sshd.pam 294 RMD160 1d4499a7de54188e51e87a240ec7a1b3b1af583d SHA1 4cd17fb40793fa9ca77ac93698129f2c8cafd7b8 SHA256 f01cc51c624b21a815fb6c0be35edc590e2e6f8a5ffbdcabc220a9630517972f @@ -25,7 +27,9 @@ DIST openssh-5.0p1.tar.gz 1011556 RMD160 b813234014e339fe2d9d10a5adad9f8e065918f DIST openssh-5.1p1+x509-6.1.1.diff.gz 152642 RMD160 ec9885a90be95d8b260f8a40f4b7e739e4b0ca4b SHA1 08f252adb10787aa8c7aba9cce8a680176f3b776 SHA256 2821d8fe003337569d6551fd26a387f53b4adc9b59f2b0131659936e11966eb3 DIST openssh-5.1p1-hpn13v5.diff.gz 23017 RMD160 6466cd0825e80366adc1978069e3c61255e0bde7 SHA1 c2911f04f8d46a28afa9f9cbb7ec226cb2c893d1 SHA256 81bebd71fb0aa8a265c0576aa3c42c0fdf263712db771f12d35c8aff09523aab DIST openssh-5.1p1.tar.gz 1040041 RMD160 24293ad89633cfd4791f08eb3442becb7e5788ca SHA1 877ea5b283060fe0160e376ea645e8e168047ff5 SHA256 f05358164dae1021386ae57be53a5e9f5cba7a1f8c9beaa428299e28a5666d75 +DIST openssh-5.2p1+x509-6.2.1.diff.gz 153887 RMD160 3642946adfc122f28fb80518719040dddacf84ea SHA1 e48447e4335c543f4b702b3e3d0e41d6d9f7f6aa SHA256 9a745634eaf450fb2c0f9dcc31f3021dcd70d6bbdba0ae5b6952f2dfcb21ee55 DIST openssh-5.2p1+x509-6.2.diff.gz 153010 RMD160 a4d7675edc87ee34d4fbc912ca03830936abee5e SHA1 cb5508827185412295b997705711f9f7697ace4e SHA256 72cfb1e232b6ae0a9df6e8539a9f6b53db7c0a2141cf2e4dd65b407748fa9f34 +DIST openssh-5.2p1-gsskex-all-20090726.patch 90959 RMD160 45763e73aa65181d56aafed9ab7dd217150769f2 SHA1 64058c69fb866a8ab0233d454f3bb8e94a0b9db7 SHA256 6eb297d6fa74be3323c5e4f53df5b6e1f4edf6bf394e3e707c075846886e18e7 DIST openssh-5.2p1-hpn13v6.diff.gz 33540 RMD160 d647d3b0547e4d698c616f5ed6643b3ddbcced95 SHA1 9683d5feb3f7e302ef836901af5366df6c425815 SHA256 90a395037a826a8ebcff68be8e46ddce1f89fd776c312c0e10e73cb703ed21bd DIST openssh-5.2p1.tar.gz 1016612 RMD160 7c53f342034b16e9faa9f5a09ef46390420722eb SHA1 8273a0237db98179fbdc412207ff8eb14ff3d6de SHA256 4023710c37d0b3d79e6299cb79b6de2a31db7d581fe59e775a5351784034ecae DIST openssh-5.2pkcs11-0.26.tar.bz2 18642 RMD160 07093fb2ad47247b2f028fae4fe1b80edf4ddaf8 SHA1 755793398e1b04ee6c15458a69ce4ad68d2abee0 SHA256 9655f118c614f76cfdd3164b5c0e3e430f20a4ce16c65df0dc1b594648cf1c07 @@ -36,12 +40,13 @@ EBUILD openssh-5.1_p1-r2.ebuild 5462 RMD160 f36841058b21ed27a1852a5b1570939c2ad7 EBUILD openssh-5.1_p1-r3.ebuild 5733 RMD160 ae05c5c6b827c4adf7f90ed72900cbc08d199987 SHA1 3b6c919a7b3f02ffe06d8a4adf55c0e9bc6147b2 SHA256 95d7848fd4cb2db527f69dfcb8823875d205808a5398b9728b495507d62f59a8 EBUILD openssh-5.2_p1-r1.ebuild 7043 RMD160 9a9579456e6b43999a0790e3cf944433c6951c2f SHA1 e927678c9c53d69bc1255b5e37109b1a09bf94bd SHA256 5aab22f63de5b020644d992abfca873aa48ed51e75721c38ebffd6f442f3ded2 EBUILD openssh-5.2_p1-r2.ebuild 8254 RMD160 3a94f684d2d3d616fd1c5deb9358552de3da029f SHA1 3ebf90d0cf330ae550e49d48bc477557b9ad4e10 SHA256 44398406407a2fd77149cc2e0f90e26b98c2e7149582cdcc1007226081585883 -MISC ChangeLog 55986 RMD160 f6cb98309e2c85eb2f260da27cdbf876d516b6f0 SHA1 33da00fc376f809dd2ac0310cfda8877cccc73d3 SHA256 7c21389af13e5b15166ec1db41b20c8a113307a2866a5d0338face5b8a7350eb +EBUILD openssh-5.2_p1-r3.ebuild 8161 RMD160 46dbde547ce09c7b34dbaa0609ae1bab63b0de4e SHA1 822cc34a589648c9d7bcfcb88414290389485c01 SHA256 d335edd31ffbd9c4e01d434b292cf8f7d4012fd8779105ef1ff58c7a34c11913 +MISC ChangeLog 56300 RMD160 af5f88dd00c4f34019286b8d71c18ec87e61e20f SHA1 9f55e943218173cd3dec0dffc1737839ec9c19b5 SHA256 022b250a5bbadfb594c4add227ca9e81c9ea7c224c7b3732f2f93de648ba0425 MISC metadata.xml 1641 RMD160 b5ae0d7b86c8dcb36414bc31da6fd22a807ced0b SHA1 31923a9db53fcad2b9cca72c39e733376bf6c501 SHA256 d34bb27c9f775ce973246c2a6b32ccd17d300de562920afbdd47312056cd8946 -----BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.12 (GNU/Linux) +Version: GnuPG v2.0.11 (GNU/Linux) -iEYEARECAAYFAkqDsxAACgkQlPl3HsVfCDq1IQCfQk8RCfd0uX67w3b4J2qtBsY2 -PvYAnihlgv/bTYSGlpB3YsyNV1Qcj6Cj -=CMsa +iEYEARECAAYFAkqRHAsACgkQlPl3HsVfCDo4vgCeJ17P3dDA8BUKNf6T1Wai/c12 +cOYAnRw8dupFMrN3QfwXW5x1Ytz2Dw4o +=t/Ds -----END PGP SIGNATURE----- diff --git a/net-misc/openssh/files/openssh-5.2_p1-gsskex-fix.patch b/net-misc/openssh/files/openssh-5.2_p1-gsskex-fix.patch new file mode 100644 index 000000000000..8112d6252f25 --- /dev/null +++ b/net-misc/openssh/files/openssh-5.2_p1-gsskex-fix.patch @@ -0,0 +1,16 @@ +--- clientloop.c ++++ clientloop.c +@@ -1434,11 +1434,13 @@ + if (!rekeying) { + channel_after_select(readset, writeset); + ++#ifdef GSSAPI + if (options.gss_renewal_rekey && + ssh_gssapi_credentials_updated(GSS_C_NO_CONTEXT)) { + debug("credentials updated - forcing rekey"); + need_rekeying = 1; + } ++#endif + + if (need_rekeying || packet_need_rekeying()) { + debug("need rekeying"); diff --git a/net-misc/openssh/files/openssh-5.2_p1-x509-hpn-glue.patch b/net-misc/openssh/files/openssh-5.2_p1-x509-hpn-glue.patch new file mode 100644 index 000000000000..9428b74f3ca0 --- /dev/null +++ b/net-misc/openssh/files/openssh-5.2_p1-x509-hpn-glue.patch @@ -0,0 +1,91 @@ +Move things around so hpn applies cleanly when using X509. + +--- openssh-5.2p1+x509/Makefile.in ++++ openssh-5.2p1+x509/Makefile.in +@@ -44,11 +44,12 @@ + CC=@CC@ + LD=@LD@ + CFLAGS=@CFLAGS@ +-CPPFLAGS=-I. -I$(srcdir) @CPPFLAGS@ @LDAP_CPPFLAGS@ $(PATHS) @DEFS@ ++CPPFLAGS=-I. -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@ + LIBS=@LIBS@ + SSHDLIBS=@SSHDLIBS@ + LIBEDIT=@LIBEDIT@ + LIBLDAP=@LDAP_LDFLAGS@ @LDAP_LIBS@ ++CPPFLAGS += @LDAP_CPPFLAGS@ + AR=@AR@ + AWK=@AWK@ + RANLIB=@RANLIB@ +--- openssh-5.2p1+x509/servconf.c ++++ openssh-5.2p1+x509/servconf.c +@@ -108,6 +108,17 @@ + options->log_level = SYSLOG_LEVEL_NOT_SET; + options->rhosts_rsa_authentication = -1; + options->hostbased_authentication = -1; ++ options->hostbased_algorithms = NULL; ++ options->pubkey_algorithms = NULL; ++ ssh_x509flags_initialize(&options->x509flags, 1); ++#ifndef SSH_X509STORE_DISABLED ++ ssh_x509store_initialize(&options->ca); ++#endif /*ndef SSH_X509STORE_DISABLED*/ ++#ifdef SSH_OCSP_ENABLED ++ options->va.type = -1; ++ options->va.certificate_file = NULL; ++ options->va.responder_url = NULL; ++#endif /*def SSH_OCSP_ENABLED*/ + options->hostbased_uses_name_from_packet_only = -1; + options->rsa_authentication = -1; + options->pubkey_authentication = -1; +@@ -152,18 +163,6 @@ + options->adm_forced_command = NULL; + options->chroot_directory = NULL; + options->zero_knowledge_password_authentication = -1; +- +- options->hostbased_algorithms = NULL; +- options->pubkey_algorithms = NULL; +- ssh_x509flags_initialize(&options->x509flags, 1); +-#ifndef SSH_X509STORE_DISABLED +- ssh_x509store_initialize(&options->ca); +-#endif /*ndef SSH_X509STORE_DISABLED*/ +-#ifdef SSH_OCSP_ENABLED +- options->va.type = -1; +- options->va.certificate_file = NULL; +- options->va.responder_url = NULL; +-#endif /*def SSH_OCSP_ENABLED*/ + } + + void +@@ -341,6 +340,16 @@ + /* Portable-specific options */ + sUsePAM, + /* Standard Options */ ++ sHostbasedAlgorithms, ++ sPubkeyAlgorithms, ++ sX509KeyAlgorithm, ++ sAllowedClientCertPurpose, ++ sKeyAllowSelfIssued, sMandatoryCRL, ++ sCACertificateFile, sCACertificatePath, ++ sCARevocationFile, sCARevocationPath, ++ sCAldapVersion, sCAldapURL, ++ sVAType, sVACertificateFile, ++ sVAOCSPResponderURL, + sPort, sHostKeyFile, sServerKeyBits, sLoginGraceTime, sKeyRegenerationTime, + sPermitRootLogin, sLogFacility, sLogLevel, + sRhostsRSAAuthentication, sRSAAuthentication, +@@ -364,16 +373,6 @@ + sMatch, sPermitOpen, sForceCommand, sChrootDirectory, + sUsePrivilegeSeparation, sAllowAgentForwarding, + sZeroKnowledgePasswordAuthentication, +- sHostbasedAlgorithms, +- sPubkeyAlgorithms, +- sX509KeyAlgorithm, +- sAllowedClientCertPurpose, +- sKeyAllowSelfIssued, sMandatoryCRL, +- sCACertificateFile, sCACertificatePath, +- sCARevocationFile, sCARevocationPath, +- sCAldapVersion, sCAldapURL, +- sVAType, sVACertificateFile, +- sVAOCSPResponderURL, + sDeprecated, sUnsupported + } ServerOpCodes; + diff --git a/net-misc/openssh/openssh-5.2_p1-r3.ebuild b/net-misc/openssh/openssh-5.2_p1-r3.ebuild new file mode 100644 index 000000000000..804ab1a67e45 --- /dev/null +++ b/net-misc/openssh/openssh-5.2_p1-r3.ebuild @@ -0,0 +1,255 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/openssh-5.2_p1-r3.ebuild,v 1.1 2009/08/23 10:37:47 vapier Exp $ + +inherit eutils flag-o-matic multilib autotools pam + +# Make it more portable between straight releases +# and _p? releases. +PARCH=${P/_/} + +HPN_PATCH="${PARCH}-hpn13v6.diff.gz" +LDAP_PATCH="${PARCH/openssh/openssh-lpk}-0.3.11.patch.gz" +PKCS11_PATCH="${PARCH/p1}pkcs11-0.26.tar.bz2" +X509_VER="6.2.1" X509_PATCH="${PARCH}+x509-${X509_VER}.diff.gz" + +DESCRIPTION="Port of OpenBSD's free SSH release" +HOMEPAGE="http://www.openssh.org/" +# HPN appears twice as sometimes Gentoo has a custom version of it. +SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz + http://www.sxw.org.uk/computing/patches/openssh-5.2p1-gsskex-all-20090726.patch + ${HPN_PATCH:+hpn? ( http://www.psc.edu/networking/projects/hpn-ssh/${HPN_PATCH} )} + ${LDAP_PATCH:+ldap? ( mirror://gentoo/${LDAP_PATCH} )} + ${PKCS11_PATCH:+pkcs11? ( http://alon.barlev.googlepages.com/${PKCS11_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 ~sparc-fbsd ~x86 ~x86-fbsd" +IUSE="hpn kerberos ldap libedit pam pkcs11 selinux skey smartcard 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 + smartcard? ( dev-libs/opensc ) + pkcs11? ( dev-libs/pkcs11-helper ) + tcpd? ( >=sys-apps/tcp-wrappers-7.6 ) + X? ( x11-apps/xauth ) + userland_GNU? ( sys-apps/shadow )" +DEPEND="${RDEPEND} + dev-util/pkgconfig + virtual/os-headers + sys-devel/autoconf" +RDEPEND="${RDEPEND} + pam? ( >=sys-auth/pambase-20081028 )" +PROVIDE="virtual/ssh" + +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} ]] && use ${1} && echo ${1} ; } + local fail=" + $(maybe_fail ldap LDAP_PATCH) + $(maybe_fail pkcs11 PKCS11_PATCH) + $(maybe_fail X509 X509_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 +} + +src_unpack() { + unpack ${PARCH}.tar.gz + cd "${S}" + + sed -i \ + -e '/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:/usr/bin/xauth:' \ + pathnames.h || die + + if use pkcs11 ; then + cd "${WORKDIR}" + unpack "${PKCS11_PATCH}" + cd "${S}" + EPATCH_OPTS="-p1" epatch "${WORKDIR}"/*pkcs11*/{1,2,4}* + use X509 && EPATCH_OPTS="-R" epatch "${WORKDIR}"/*pkcs11*/1000_all_log.patch + fi + use X509 && epatch "${DISTDIR}"/${X509_PATCH} "${FILESDIR}"/${P}-x509-hpn-glue.patch + use smartcard && epatch "${FILESDIR}"/openssh-3.9_p1-opensc.patch + if ! use X509 ; then + if [[ -n ${LDAP_PATCH} ]] && use ldap ; then + # The patch for bug 210110 64-bit stuff is now included. + epatch "${DISTDIR}"/${LDAP_PATCH} + epatch "${FILESDIR}"/${PN}-5.2p1-ldap-stdargs.diff #266654 + fi + epatch "${DISTDIR}"/openssh-5.2p1-gsskex-all-20090726.patch #115553 #216932 #279488 + epatch "${FILESDIR}"/${P}-gsskex-fix.patch + else + use ldap && ewarn "Sorry, X509 and ldap don't get along, disabling ldap" + fi + #epatch "${FILESDIR}"/${PN}-4.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex + [[ -n ${HPN_PATCH} ]] && use hpn && epatch "${DISTDIR}"/${HPN_PATCH} + epatch "${FILESDIR}"/${PN}-4.7p1-selinux.diff #191665 + epatch "${FILESDIR}"/${P}-autoconf.patch + + # in 5.2p1, the AES-CTR multithreaded variant is temporarily broken, and + # causes random hangs when combined with the -f switch of ssh. + # To avoid this, we change the internal table to use the non-multithread + # version for the meantime. + sed -i \ + -e '/aes...-ctr.*SSH_CIPHER_SSH2/s,evp_aes_ctr_mt,evp_aes_128_ctr,' \ + cipher.c || die + + 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 + + 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 + [[ -z $1 ]] && flag="${flag} ${flag}" + shift + set -- !${flag} "$@" + fi + use_with "$@" +} + +src_compile() { + addwrite /dev/ptmx + addpredict /etc/skey/skeykeys #skey configure code triggers this + + local myconf="" + 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 ldap && use_with ldap)} \ + $(use_with libedit) \ + ${PKCS11_PATCH:+$(use pkcs11 && static_use_with pkcs11)} \ + $(use_with selinux) \ + $(use_with skey) \ + $(use_with smartcard opensc) \ + $(use_with tcpd tcp-wrappers) \ + ${myconf} \ + || die "bad configure" + emake || die "compile problem" +} + +src_install() { + emake install-nokeys DESTDIR="${D}" || die + fperms 600 /etc/ssh/sshd_config + dobin contrib/ssh-copy-id + newinitd "${FILESDIR}"/sshd.rc6 sshd + newconfd "${FILESDIR}"/sshd.confd sshd + keepdir /var/empty + + 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 + + doman contrib/ssh-copy-id.1 + dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config + + diropts -m 0700 + dodir /etc/skel/.ssh +} + +src_test() { + local t tests skipped failed passed shell + tests="interop-tests compat-tests" + skipped="" + shell=$(getent passwd ${UID} | cut -d: -f7) + 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 + for t in ${tests} ; do + # Some tests read from stdin ... + 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_postinst() { + enewgroup sshd 22 + enewuser sshd 22 -1 /var/empty sshd + + # help fix broken perms caused by older ebuilds. + # can probably cut this after the next stage release. + chmod u+x "${ROOT}"/etc/skel/.ssh >& /dev/null + + 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 + if use pkcs11 ; then + echo + einfo "For PKCS#11 you should also emerge one of the askpass softwares" + einfo "Example: net-misc/x11-ssh-askpass" + 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 +} |