HaikuPorts
  • Login
  • Preferences
  • Help/Guide
  • Wiki
  • Timeline
  • Roadmap
  • View Tickets
  • Search
  • Port Log
  • Blog

Context Navigation

  • ← Previous Ticket
  • Next Ticket →

Ticket #475 (closed enhancement: fixed)

Opened 5 years ago

Last modified 4 years ago

[openssh] Move _progress call into if blocks in sshd_keymaker.sh

Reported by: diver Owned by: scottmc
Priority: normal Milestone:
Component: net-misc/openssh Version:
Severity: normal Keywords:
Cc:

Description

See r1188.
Move _progress call into if blocks to prevent notification in case ssh keys was already in place, e.g. via UserBuildConfig?:

ExtractArchiveToHaikuImage common settings :   $(HAIKU_TOP)/ssh_keys.zip ;

Alternatively we can check if ${SETTINGSSSHDIR} exist end exit, not sure which way is better.

Original sshd_keymaker.sh:

#!/bin/sh

_progress () {
        notify --type progress --app ssh-keygen \
                --icon /boot/system/kernel_x86 \
                --messageID $0_$$ \
                --title "Generating ssh keys..." \
                --progress "$1" "$2" >/dev/null
}

# generate SSH host keys

SETTINGSSSHDIR=`finddir B_COMMON_SETTINGS_DIRECTORY`/ssh
mkdir -p ${SETTINGSSSHDIR}

hostKeyDir=${SETTINGSSSHDIR}

_progress 0.0 "rsa1"
if [ ! -f "$hostKeyDir/ssh_host_key" ] ; then
        ssh-keygen -t rsa1 -f "$hostKeyDir/ssh_host_key" -N ""
fi

_progress 0.3 "dsa"
if [ ! -f "$hostKeyDir/ssh_host_dsa_key" ] ; then
        ssh-keygen -t dsa -f "$hostKeyDir/ssh_host_dsa_key" -N ""
fi

_progress 0.6 "rsa"
if [ ! -f "$hostKeyDir/ssh_host_rsa_key" ] ; then
        ssh-keygen -t rsa -f "$hostKeyDir/ssh_host_rsa_key" -N ""
fi

_progress 1.0 ""

Modified sshd_keymaker.sh:

#!/bin/sh

_progress () {
        notify --type progress --app ssh-keygen \
                --icon /boot/system/kernel_x86 \
                --messageID $0_$$ \
                --title "Generating ssh keys..." \
                --progress "$1" "$2" >/dev/null
}

# generate SSH host keys

SETTINGSSSHDIR=`finddir B_COMMON_SETTINGS_DIRECTORY`/ssh
mkdir -p ${SETTINGSSSHDIR}

hostKeyDir=${SETTINGSSSHDIR}

if [ ! -f "$hostKeyDir/ssh_host_key" ] ; then
        _progress 0.0 "rsa1"
        ssh-keygen -t rsa1 -f "$hostKeyDir/ssh_host_key" -N ""
fi

if [ ! -f "$hostKeyDir/ssh_host_dsa_key" ] ; then
        _progress 0.3 "dsa"
        ssh-keygen -t dsa -f "$hostKeyDir/ssh_host_dsa_key" -N ""
fi

if [ ! -f "$hostKeyDir/ssh_host_rsa_key" ] ; then
        _progress 0.6 "rsa"
        ssh-keygen -t rsa -f "$hostKeyDir/ssh_host_rsa_key" -N ""
        _progress 1.0 ""
fi

Change History

comment:1 Changed 4 years ago by scottmc

  • Resolution set to fixed
  • Status changed from new to closed

applied in r1281, this will be added to Haiku when openssh5.7p1 is released.

Note: See TracTickets for help on using tickets.

Download in other formats:

  • Comma-delimited Text
  • Tab-delimited Text
  • RSS Feed

Trac Powered

Powered by Trac 0.13dev-r10686
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/