From 9a38850bcc9b7eab4799eedcfd8ca83a065391d5 Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Wed, 28 Nov 2012 01:07:04 +0000 Subject: Bug #410541: prepare for detection of net variants to warn if the user needs a rc_need for the actual interface to bind to. Not installed in the rebuild pending ACK fro vapier. (Portage version: 2.2.0_alpha142/cvs/Linux x86_64, unsigned Manifest commit) --- net-misc/openssh/ChangeLog | 7 ++++++- net-misc/openssh/files/sshd.rc6.4 | 33 +++++++++++++++++++++++++++------ 2 files changed, 33 insertions(+), 7 deletions(-) (limited to 'net-misc/openssh') diff --git a/net-misc/openssh/ChangeLog b/net-misc/openssh/ChangeLog index a250219dfbaf..e7294a41fcb1 100644 --- a/net-misc/openssh/ChangeLog +++ b/net-misc/openssh/ChangeLog @@ -1,6 +1,11 @@ # 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.460 2012/11/28 00:32:24 robbat2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/ChangeLog,v 1.461 2012/11/28 01:07:04 robbat2 Exp $ + + 28 Nov 2012; Robin H. Johnson files/sshd.rc6.4: + Bug #410541: prepare for detection of net variants to warn if the user needs a + rc_need for the actual interface to bind to. Not installed in the rebuild + pending ACK fro vapier. 28 Nov 2012; Robin H. Johnson +files/sshd.rc6.4: Cleanup of sshd init.d in preparation for bug #410541. local keyword is not diff --git a/net-misc/openssh/files/sshd.rc6.4 b/net-misc/openssh/files/sshd.rc6.4 index d636327f2287..7a4be213640a 100755 --- a/net-misc/openssh/files/sshd.rc6.4 +++ b/net-misc/openssh/files/sshd.rc6.4 @@ -1,20 +1,41 @@ #!/sbin/runscript # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/files/sshd.rc6.4,v 1.1 2012/11/28 00:32:24 robbat2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/files/sshd.rc6.4,v 1.2 2012/11/28 01:07:04 robbat2 Exp $ extra_commands="checkconfig gen_keys" extra_started_commands="reload" -depend() { - use logger dns - need net -} - SSHD_CONFDIR=${SSHD_CONFDIR:-/etc/ssh} +SSHD_CONFIG=${SSHD_CONFIG:-${SSHD_CONFDIR}/sshd_config} SSHD_PIDFILE=${SSHD_PIDFILE:-/var/run/${SVCNAME}.pid} SSHD_BINARY=${SSHD_BINARY:-/usr/sbin/sshd} +depend() { + use logger dns + if [ "${rc_need+set}" = "set" ]; then + : # Do nothing, the user has explicitly set rc_need + else + warn_addr='' + for x in $(awk '/^ListenAddress/{ print $2 }' "$SSHD_CONFIG" 2>/dev/null) ; do + case "$x" in + 0.0.0.0|0.0.0.0:*) ;; + ::|\[::\]*) ;; + *) warn_addr="${warn_addr} $x" ;; + esac + done + unset x + if [ "${warn_addr:+set}" = "set" ]; then + need net + ewarn "You are binding an interface in ListenAddress statement in your sshd_config!" + ewarn "You must add rc_need=\"net.FOO\" to your /etc/conf.d/sshd" + ewarn "where FOO is the interface(s) providing the following address(es):" + ewarn "${warn_addr}" + fi + unset warn_addr + fi +} + checkconfig() { if [ ! -d /var/empty ] ; then mkdir -p /var/empty || return 1 -- cgit v1.2.3-65-gdbad