bug-coreutils@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: "Pádraig Brady" <P@draigBrady.com>
To: Daniel Hofstetter <dhofstet@gmail.com>, 69546-done@debbugs.gnu.org
Subject: bug#69546: cksum: inconsistent handling of invalid length values
Date: Mon, 4 Mar 2024 16:39:05 +0000	[thread overview]
Message-ID: <85c0d54c-d208-6eda-3997-d68e15f93d5d@draigBrady.com> (raw)
In-Reply-To: <CAFRQvFq65eAQVsL_Yks3YdOzbuzW-QLcoggtKGS2=g3BP3afyA@mail.gmail.com>

On 04/03/2024 15:44, Daniel Hofstetter wrote:
> Hi,
> 
> When specifying an invalid length value followed by a valid length
> value I get the following error:
> 
> $ printf "hello" | cksum --algo=blake2b --length=12 --length=8
> cksum: invalid length: ‘12’
> cksum: length is not a multiple of 8
> 
> However, if the invalid length value is a multiple of 8 and greater
> than 512 (the maximum digest length for blake2b), there is no error:
> 
> $ printf "hello" | cksum --algo=blake2b --length=123456 --length=8
> BLAKE2b-8 (-) = 29
> 
> I think the behavior should be the same in the two scenarios, whether
> it's showing an error or ignoring the invalid value.
> 
> I'm using coreutils 9.4.

I pushed a fix at:
https://github.com/coreutils/coreutils/commit/fea833591

Now only the last used --length is validated.

Marking this as done.

cheers,
Pádraig





      reply	other threads:[~2024-03-04 16:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-04 15:44 bug#69546: cksum: inconsistent handling of invalid length values Daniel Hofstetter
2024-03-04 16:39 ` Pádraig Brady [this message]

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

  List information: https://lists.gnu.org/mailman/listinfo/bug-coreutils

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

  git send-email \
    --in-reply-to=85c0d54c-d208-6eda-3997-d68e15f93d5d@draigBrady.com \
    --to=p@draigbrady.com \
    --cc=69546-done@debbugs.gnu.org \
    --cc=dhofstet@gmail.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).