grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] cryptodisk: allow the user to retry failed passphrases


From: Forest
Subject: Re: [PATCH v2] cryptodisk: allow the user to retry failed passphrases
Date: Sat, 27 Apr 2024 17:10:00 -0700

On Sat, 27 Apr 2024 04:18:29 -0500, Glenn Washburn wrote:

>Its also a good idea to always CC Daniel on patches. They may more easily
>get dropped otherwise.

Thanks. Will do.

>This does not account for tries_env not being a numeric value with no
>garbage at the end or the empty string. I think the above line should be
>replaced with:
>
>if (tries_env != NULL && tries_env[0] != '\0')
>  {
>    const char *p = NULL;
>    tries = grub_strtoul (tries_env, &p, 0);
>
>    if (*p != '\0')
>      {
>       grub_error (grub_errno,
>                   N_("non-numeric or invalid value for 
> cryptodisk_passphrase_tries: `%s'"),
>                   tries_env);
>       goto error;
>      }
>  }

This doesn't account for grub_strtoul() ignoring trailing text, so it
generates an error with a potentially stale/misleading grub_errno value.

My next rev will include your suggestion with a fix for that case.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]