mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <mol@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: u.kleine-koenig@pengutronix.de
Subject: Re: [ptxdist] [APPLIED] openssh/rc-once: use fixed string grep to match filename
Date: Mon, 17 Aug 2020 08:18:25 +0200	[thread overview]
Message-ID: <E1k7YTR-0008FS-TL@dude02.hi.pengutronix.de> (raw)
In-Reply-To: <20200808083456.26483-2-u.kleine-koenig@pengutronix.de>

Thanks, applied as 99931412f758783a6d27bd8df3119bb3ce1e0aa6.

Michael

[sent from post-receive hook]

On Mon, 17 Aug 2020 08:18:25 +0200, Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
> This is a (very) minor optimisation. There is no semantical change as
> the fixed list of possible filenames doesn't contain anything that has a
> different meaning when interpreted as a regex, still I consider it
> better style to interpret the filename as a fixed string to match.
> 
> Both busybox and the "big" grep support -F unconditionally so there is
> no problem in using -F.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Message-Id: <20200808083456.26483-2-u.kleine-koenig@pengutronix.de>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> diff --git a/projectroot/etc/rc.once.d/openssh b/projectroot/etc/rc.once.d/openssh
> index bfec7064181a..66cfa06df12a 100644
> --- a/projectroot/etc/rc.once.d/openssh
> +++ b/projectroot/etc/rc.once.d/openssh
> @@ -26,7 +26,7 @@ create_key() {
>  
>  	file="/etc/ssh/ssh_host_${keytype}_key"
>  
> -	if echo "$hostkeys" | grep -x "$file" >/dev/null; then
> +	if echo "$hostkeys" | grep -x -F "$file" >/dev/null; then
>  		echo "Create $prettykeytype key; this may take some time ..."
>  		rm -f $file &&
>  		ssh-keygen -q -f "$file" -N '' -t "$keytype" "$@" || return

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

  reply	other threads:[~2020-08-17  6:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-08  8:34 [ptxdist] [PATCH v2 1/2] openssh/rc-once: deduplicate some data Uwe Kleine-König
2020-08-08  8:34 ` [ptxdist] [PATCH v2 2/2] openssh/rc-once: use fixed string grep to match filename Uwe Kleine-König
2020-08-17  6:18   ` Michael Olbrich [this message]
2020-08-17  6:18 ` [ptxdist] [APPLIED] openssh/rc-once: deduplicate some data Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1k7YTR-0008FS-TL@dude02.hi.pengutronix.de \
    --to=mol@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox