summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/openssh/openssh-7.7_p1-r5.ebuild')
-rw-r--r--net-misc/openssh/openssh-7.7_p1-r5.ebuild44
1 files changed, 26 insertions, 18 deletions
diff --git a/net-misc/openssh/openssh-7.7_p1-r5.ebuild b/net-misc/openssh/openssh-7.7_p1-r5.ebuild
index 8ce813c89ca3..cadc21098354 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/