[pacman-dev] [PATCH] FS#66472: correct length of ".files.sig" string

Anatol Pomozov anatol.pomozov at gmail.com
Wed Jan 20 18:10:19 UTC 2021


Hi

On Tue, Jan 19, 2021 at 8:37 PM Pascal Ernster
<pacman-dev at hardfalcon.net> wrote:
>
>
> Signed-off-by: Pascal Ernster <pacman-dev at hardfalcon.net>
> ---
>   src/pacman/sync.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/pacman/sync.c b/src/pacman/sync.c
> index a05af5da..9ec4c92e 100644
> --- a/src/pacman/sync.c
> +++ b/src/pacman/sync.c
> @@ -105,7 +105,7 @@ static int sync_cleandb(const char *dbpath)
>                         dbname = strndup(dname, len - 7);
>                 } else if(len > 6 && strcmp(dname + len - 6, ".files") == 0) {
>                         dbname = strndup(dname, len - 6);
> -               } else if(len > 6 && strcmp(dname + len - 6, ".files.sig") == 0) {
> +               } else if(len > 10 && strcmp(dname + len - 10, ".files.sig") == 0) {
>                         dbname = strndup(dname, len - 10);
>                 } else {
>                         ret += unlink_verbose(path, 0);

Thank you. The fix looks good.

It would be great to have a bit more verbose commit message, including
description of the user error (i.e. how this error manifests to a
pacman user) and steps to reproduce it.


More information about the pacman-dev mailing list