public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Nick Howitt <nick@howitts.co.uk>
To: development@lists.ipfire.org
Subject: Re: [PATCH] core194: Fix cert name and change other check to ! -z
Date: Wed, 30 Apr 2025 15:53:44 +0100	[thread overview]
Message-ID: <09f1b0d4-a0ad-43ae-b71a-4c1d53d95b6d@howitts.co.uk> (raw)
In-Reply-To: <20250430141746.44261-1-adolf.belka@ipfire.org>

[-- Attachment #1: Type: text/plain, Size: 1588 bytes --]

Can I ask what you are testing here with the "! -z"? Typically you would 
use "-n" rather than "! -z", but both are tests for strings and not 
files - https://tldp.org/LDP/abs/html/comparison-ops.html. "! -s" would 
test for a zero length file and if the file exists at all.

Nick

On 30/04/2025 15:17, Adolf Belka wrote:
> - Error in hostcert extension
> - -z gives true if not zero and we need true if it is zero so had to add not command.
> - I thought I had tested the original patch of this change but obviously not because
>     there was missing whitespace and filenames not quoted plus the fixes I have added
>     in this patch.
> - I definitely tested this out this time by copying it from the update.sh and applying
>     it to my vm system.
>
> Tested-by: Adolf Belka<adolf.belka@ipfire.org>
> Signed-off-by: Adolf Belka<adolf.belka@ipfire.org>
> ---
>   config/rootfiles/core/194/update.sh | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/config/rootfiles/core/194/update.sh b/config/rootfiles/core/194/update.sh
> index b758c7bf6..8fbf22750 100644
> --- a/config/rootfiles/core/194/update.sh
> +++ b/config/rootfiles/core/194/update.sh
> @@ -104,7 +104,7 @@ ldconfig
>   /usr/local/bin/filesystem-cleanup
>   
>   # Increment ipsec serial file if x509 certificates present and no content in index.txt
> -if [ -e "/var/ipfire/certs/hostcert.pm" ] && [ -z "/var/ipfire/certs/index.txt" ]; then
> +if [ -e "/var/ipfire/certs/hostcert.pem" ] && [ ! -z "/var/ipfire/certs/index.txt" ]; then
>       sed -i "s/01/02/" /var/ipfire/certs/serial
>   fi
>   

[-- Attachment #2: Type: text/html, Size: 2284 bytes --]

  reply	other threads:[~2025-04-30 14:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-30 14:17 Adolf Belka
2025-04-30 14:53 ` Nick Howitt [this message]
2025-04-30 16:29   ` Adolf Belka

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=09f1b0d4-a0ad-43ae-b71a-4c1d53d95b6d@howitts.co.uk \
    --to=nick@howitts.co.uk \
    --cc=development@lists.ipfire.org \
    /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