From 5fb555b7facf2cf11a92afec9498dd928af0a6d8 Mon Sep 17 00:00:00 2001 From: Jan F. Chadima Date: Oct 29 2009 09:30:48 +0000 Subject: Modify the init script to prevent it to hang during generating the keys --- diff --git a/openssh.spec b/openssh.spec index dcc3e7f..7fdd463 100644 --- a/openssh.spec +++ b/openssh.spec @@ -69,7 +69,7 @@ Summary: An open source implementation of SSH protocol versions 1 and 2 Name: openssh Version: 5.3p1 -Release: 5%{?dist}%{?rescue_rel} +Release: 6%{?dist}%{?rescue_rel} URL: http://www.openssh.com/portable.html #URL1: http://pamsshauth.sourceforge.net #Source0: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz @@ -521,6 +521,9 @@ fi %endif %changelog +* Thu Oct 29 2009 Jan F. Chadima - 5.3p1-6 +- Modify the init script to prevent it to hang during generating the keys (#515145) + * Tue Oct 27 2009 Jan F. Chadima - 5.3p1-5 - Add README.nss diff --git a/sshd.init b/sshd.init index 72d3512..3bc2cc4 100755 --- a/sshd.init +++ b/sshd.init @@ -49,7 +49,8 @@ runlevel=$(set -- $(runlevel); eval "echo \$$#" ) do_rsa1_keygen() { if [ ! -s $RSA1_KEY ]; then echo -n $"Generating SSH1 RSA host key: " - if $KEYGEN -q -t rsa1 -f $RSA1_KEY -C '' -N '' >&/dev/null; then + rm -f $RSA1_KEY + if test ! -f $RSA1_KEY && $KEYGEN -q -t rsa1 -f $RSA1_KEY -C '' -N '' >&/dev/null; then chmod 600 $RSA1_KEY chmod 644 $RSA1_KEY.pub if [ -x /sbin/restorecon ]; then @@ -68,7 +69,8 @@ do_rsa1_keygen() { do_rsa_keygen() { if [ ! -s $RSA_KEY ]; then echo -n $"Generating SSH2 RSA host key: " - if $KEYGEN -q -t rsa -f $RSA_KEY -C '' -N '' >&/dev/null; then + rm -f $RSA_KEY + if test ! -f $RSA_KEY && $KEYGEN -q -t rsa -f $RSA_KEY -C '' -N '' >&/dev/null; then chmod 600 $RSA_KEY chmod 644 $RSA_KEY.pub if [ -x /sbin/restorecon ]; then @@ -87,7 +89,8 @@ do_rsa_keygen() { do_dsa_keygen() { if [ ! -s $DSA_KEY ]; then echo -n $"Generating SSH2 DSA host key: " - if $KEYGEN -q -t dsa -f $DSA_KEY -C '' -N '' >&/dev/null; then + rm -f $DSA_KEY + if test ! -f $DSA_KEY && $KEYGEN -q -t dsa -f $DSA_KEY -C '' -N '' >&/dev/null; then chmod 600 $DSA_KEY chmod 644 $DSA_KEY.pub if [ -x /sbin/restorecon ]; then