Thanks, applied as a467e398aeed82d2a96e5e72a86aa9ac09f3e261. Michael
[sent from post-receive hook] On Fri, 10 Dec 2021 14:07:24 +0100, Alexander Dahl <[email protected]> wrote: > The return of gen_keys() never threw an error, so last block was useless > so far. Script worked because gen_key() exited instead of returning. > Messages are done like in the openssh rc-once script now. > > Fixes: cf0424f8ba23 ("dropbear: Refactor rc-once and init to use KEYTYPES") > Signed-off-by: Alexander Dahl <[email protected]> > Message-Id: <[email protected]> > Signed-off-by: Michael Olbrich <[email protected]> > > diff --git a/projectroot/etc/rc.once.d/dropbear > b/projectroot/etc/rc.once.d/dropbear > index 8a04406242e4..a8725616a7f2 100644 > --- a/projectroot/etc/rc.once.d/dropbear > +++ b/projectroot/etc/rc.once.d/dropbear > @@ -13,15 +13,9 @@ gen_key() { > > rm -f $key_file > /dev/null 2>&1 > > - echo -n "generating $key_type key..." > - dropbearkey -t $key_type -f $key_file > /dev/null 2>&1 > - > - if [ "$?" = "0" ]; then > - echo "done" > - else > - echo "failed" > - exit 1 > - fi > + echo "Create $key_type key; this may take some time ..." > + dropbearkey -t $key_type -f $key_file > /dev/null 2>&1 || return > + echo "Created $key_type key." > } > > gen_keys() { > @@ -29,10 +23,10 @@ gen_keys() { > do > case "$keytype" in > rsa) > - gen_key rsa "$DROPBEAR_RSAKEY" > + gen_key rsa "$DROPBEAR_RSAKEY" || return > ;; > ecdsa) > - gen_key ecdsa "$DROPBEAR_ECDSAKEY" > + gen_key ecdsa "$DROPBEAR_ECDSAKEY" || return > ;; > *) > echo "Key type '$keytype' not supported" _______________________________________________ ptxdist mailing list [email protected] To unsubscribe, send a mail with subject "unsubscribe" to [email protected]
