From ff7ff3c58dcdb858c253e8e7fea1d758cdff0312 Mon Sep 17 00:00:00 2001 From: Anatol Pomozov Date: Mon, 14 Sep 2020 18:52:56 -0700 Subject: FS#66472: Remove *.sig file if package corrupted In case if a package corrupted (e.g. signature or hash is invalid) pacman tries to remove the package file to redownload it anew the next time. Remove *.sig file as well to make sure no data is left for the invalid package. Signed-off-by: Anatol Pomozov Signed-off-by: Allan McRae --- lib/libalpm/sync.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 9350793a..601f1d69 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -688,7 +688,13 @@ static int prompt_to_delete(alpm_handle_t *handle, const char *filepath, }; QUESTION(handle, &question); if(question.remove) { + char *sig_filepath; + unlink(filepath); + + sig_filepath = _alpm_sigpath(handle, filepath); + unlink(sig_filepath); + FREE(sig_filepath); } return question.remove; } -- cgit v1.2.3-70-g09d2