diff options
author | Anatol Pomozov <anatol.pomozov@gmail.com> | 2020-09-15 03:52:56 +0200 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2020-09-23 09:12:01 +0200 |
commit | ff7ff3c58dcdb858c253e8e7fea1d758cdff0312 (patch) | |
tree | 404844a11fb5656b0965ed462d2eee39ac3fcc00 /lib/libalpm | |
parent | d85d9c8c6044bc58963c41df8b6c15de1356ab2f (diff) | |
download | pacman-ff7ff3c58dcdb858c253e8e7fea1d758cdff0312.tar.gz pacman-ff7ff3c58dcdb858c253e8e7fea1d758cdff0312.tar.xz |
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 <anatol.pomozov@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm')
-rw-r--r-- | lib/libalpm/sync.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; } |