From da74e3dd9ec884b0b11a04fc5b7ed2cfe476909a Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 9 May 2015 06:27:03 +0200 Subject: [PATCH] libxbps: stop and error out if pkg signature is not valid. --- NEWS | 3 +++ lib/transaction_commit.c | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index fb57e37f..2e91b9d9 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ xbps-0.45 (???): + * libxbps: if a pkg signature file cannot be verified, don't continue processing + other files, stop and return error immediately. + * xbps-remove(8): fixed regression while removing recursively packages, don't remove all package orphans, this task belongs to -o not -R. diff --git a/lib/transaction_commit.c b/lib/transaction_commit.c index da0a9ae5..511bb0d5 100644 --- a/lib/transaction_commit.c +++ b/lib/transaction_commit.c @@ -95,10 +95,9 @@ check_binpkgs(struct xbps_handle *xhp, xbps_object_iterator_t iter) "%s: verifying RSA signature...", pkgver); if (!xbps_verify_file_signature(repo, binfile)) { - rv = errno; + rv = EPERM; xbps_set_cb_state(xhp, XBPS_STATE_VERIFY_FAIL, rv, pkgver, - "%s: the RSA signature is not valid: %s", pkgver, - strerror(rv)); + "%s: the RSA signature is not valid!", pkgver); free(binfile); break; }