summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-08-21 19:09:30 +0000
committerMike Frysinger <vapier@gentoo.org>2005-08-21 19:09:30 +0000
commit9441f11061ea1fa1ddc106c9d5635dfa1413aa77 (patch)
tree016c01890caeb77430fe2b8792a991ec76e23ade /net-misc
parentmake sure we only glob numbers, not . #103246 (diff)
downloadgentoo-2-9441f11061ea1fa1ddc106c9d5635dfa1413aa77.tar.gz
gentoo-2-9441f11061ea1fa1ddc106c9d5635dfa1413aa77.tar.bz2
gentoo-2-9441f11061ea1fa1ddc106c9d5635dfa1413aa77.zip
move the sshd -t test after key generation, and update key generation to return failure if they didnt work
(Portage version: 2.0.51.22-r2)
Diffstat (limited to 'net-misc')
-rw-r--r--net-misc/openssh/files/sshd.rc613
1 files changed, 7 insertions, 6 deletions
diff --git a/net-misc/openssh/files/sshd.rc6 b/net-misc/openssh/files/sshd.rc6
index ec598cee8822..01083d1d0fc6 100644
--- a/net-misc/openssh/files/sshd.rc6
+++ b/net-misc/openssh/files/sshd.rc6
@@ -1,7 +1,7 @@
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/files/sshd.rc6,v 1.15 2005/08/20 03:46:44 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/files/sshd.rc6,v 1.16 2005/08/21 19:09:30 vapier Exp $
depend() {
use logger dns
@@ -19,24 +19,25 @@ checkconfig() {
return 1
fi
- /usr/sbin/sshd -t || return 1
+ gen_keys || return 1
- gen_keys
+ /usr/sbin/sshd -t || return 1
}
gen_keys() {
if [ ! -e /etc/ssh/ssh_host_key ] ; then
einfo "Generating Hostkey..."
- /usr/bin/ssh-keygen -t rsa1 -b 1024 -f /etc/ssh/ssh_host_key -N ''
+ /usr/bin/ssh-keygen -t rsa1 -b 1024 -f /etc/ssh/ssh_host_key -N '' || return 1
fi
if [ ! -e /etc/ssh/ssh_host_dsa_key ] ; then
einfo "Generating DSA-Hostkey..."
- /usr/bin/ssh-keygen -d -f /etc/ssh/ssh_host_dsa_key -N ''
+ /usr/bin/ssh-keygen -d -f /etc/ssh/ssh_host_dsa_key -N '' || return 1
fi
if [ ! -e /etc/ssh/ssh_host_rsa_key ] ; then
einfo "Generating RSA-Hostkey..."
- /usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
+ /usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N '' || return 1
fi
+ return 0
}
start() {