From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 08D8F138334 for ; Thu, 21 Jun 2018 02:36:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 004E7E092D; Thu, 21 Jun 2018 02:36:39 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B1C58E092D for ; Thu, 21 Jun 2018 02:36:38 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 43854335C7F for ; Thu, 21 Jun 2018 02:36:36 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E82792CD for ; Thu, 21 Jun 2018 02:36:34 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1529547939.3b9f17df19b6c64674257cf039d647ed6a2b99aa.vapier@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/openssh/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-misc/openssh/openssh-7.7_p1-r101.ebuild net-misc/openssh/openssh-7.7_p1-r5.ebuild X-VCS-Directories: net-misc/openssh/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 3b9f17df19b6c64674257cf039d647ed6a2b99aa X-VCS-Branch: master Date: Thu, 21 Jun 2018 02:36:34 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 79fcd2e0-c00e-4aba-a0ac-de029fd48e09 X-Archives-Hash: 8596ae92de19489c14594354ebe80b4a commit: 3b9f17df19b6c64674257cf039d647ed6a2b99aa Author: Mike Frysinger gentoo org> AuthorDate: Wed Jun 20 21:34:49 2018 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Thu Jun 21 02:25:39 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b9f17df net-misc/openssh: move ssh{,d}_config tweaks to a sep func No functional changes here. Should make managing src_install easier as all the sshd_config/ssh_config changes are kept separate. net-misc/openssh/openssh-7.7_p1-r101.ebuild | 44 +++++++++++++++++------------ net-misc/openssh/openssh-7.7_p1-r5.ebuild | 44 +++++++++++++++++------------ 2 files changed, 52 insertions(+), 36 deletions(-) diff --git a/net-misc/openssh/openssh-7.7_p1-r101.ebuild b/net-misc/openssh/openssh-7.7_p1-r101.ebuild index 69618e6b249..d330358e032 100644 --- a/net-misc/openssh/openssh-7.7_p1-r101.ebuild +++ b/net-misc/openssh/openssh-7.7_p1-r101.ebuild @@ -328,40 +328,48 @@ src_test() { [[ ${#failed[@]} -gt 0 ]] && die "Some tests failed: ${failed[*]}" } -src_install() { - emake install-nokeys DESTDIR="${D}" - fperms 600 /etc/ssh/sshd_config - dobin contrib/ssh-copy-id - newinitd "${FILESDIR}"/sshd.rc6.5 sshd - newconfd "${FILESDIR}"/sshd-r1.confd sshd - - 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:" \ - "${ED%/}"/etc/ssh/sshd_config || die - fi - - # Gentoo tweaks to default config files +# Gentoo tweaks to default config files. +tweak_ssh_configs() { + # First the server config. cat <<-EOF >> "${ED%/}"/etc/ssh/sshd_config # Allow client to pass locale environment variables #367017 AcceptEnv LANG LC_* EOF + + # Then the client config. cat <<-EOF >> "${ED%/}"/etc/ssh/ssh_config # Send locale environment variables #367017 SendEnv LANG LC_* EOF + 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:" \ + "${ED%/}"/etc/ssh/sshd_config || die + fi + if use livecd ; then sed -i \ -e '/^#PermitRootLogin/c# Allow root login with password on livecds.\nPermitRootLogin Yes' \ "${ED%/}"/etc/ssh/sshd_config || die fi +} + +src_install() { + emake install-nokeys DESTDIR="${D}" + fperms 600 /etc/ssh/sshd_config + dobin contrib/ssh-copy-id + newinitd "${FILESDIR}"/sshd.rc6.5 sshd + newconfd "${FILESDIR}"/sshd-r1.confd sshd + + newpamd "${FILESDIR}"/sshd.pam_include.2 sshd + + tweak_ssh_configs if use ldap && [[ -n ${LDAP_PATCH} ]] ; then insinto /etc/openldap/schema/ diff --git a/net-misc/openssh/openssh-7.7_p1-r5.ebuild b/net-misc/openssh/openssh-7.7_p1-r5.ebuild index 8ce813c89ca..cadc2109835 100644 --- a/net-misc/openssh/openssh-7.7_p1-r5.ebuild +++ b/net-misc/openssh/openssh-7.7_p1-r5.ebuild @@ -328,40 +328,48 @@ src_test() { [[ ${#failed[@]} -gt 0 ]] && die "Some tests failed: ${failed[*]}" } -src_install() { - emake install-nokeys DESTDIR="${D}" - fperms 600 /etc/ssh/sshd_config - dobin contrib/ssh-copy-id - newinitd "${FILESDIR}"/sshd.rc6.5 sshd - newconfd "${FILESDIR}"/sshd-r1.confd sshd - - 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:" \ - "${ED%/}"/etc/ssh/sshd_config || die - fi - - # Gentoo tweaks to default config files +# Gentoo tweaks to default config files. +tweak_ssh_configs() { + # First the server config. cat <<-EOF >> "${ED%/}"/etc/ssh/sshd_config # Allow client to pass locale environment variables #367017 AcceptEnv LANG LC_* EOF + + # Then the client config. cat <<-EOF >> "${ED%/}"/etc/ssh/ssh_config # Send locale environment variables #367017 SendEnv LANG LC_* EOF + 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:" \ + "${ED%/}"/etc/ssh/sshd_config || die + fi + if use livecd ; then sed -i \ -e '/^#PermitRootLogin/c# Allow root login with password on livecds.\nPermitRootLogin Yes' \ "${ED%/}"/etc/ssh/sshd_config || die fi +} + +src_install() { + emake install-nokeys DESTDIR="${D}" + fperms 600 /etc/ssh/sshd_config + dobin contrib/ssh-copy-id + newinitd "${FILESDIR}"/sshd.rc6.5 sshd + newconfd "${FILESDIR}"/sshd-r1.confd sshd + + newpamd "${FILESDIR}"/sshd.pam_include.2 sshd + + tweak_ssh_configs if use ldap && [[ -n ${LDAP_PATCH} ]] ; then insinto /etc/openldap/schema/