summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libalpm/signing.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
index c4cb077f..3ff83ba0 100644
--- a/lib/libalpm/signing.c
+++ b/lib/libalpm/signing.c
@@ -430,8 +430,13 @@ int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path,
if(!base64_sig) {
sigpath = _alpm_sigpath(handle, path);
- /* this will just help debugging */
- _alpm_access(handle, NULL, sigpath, R_OK);
+ if(_alpm_access(handle, NULL, sigpath, R_OK) != 0
+ || (sigfile = fopen(sigpath, "rb")) == NULL) {
+ _alpm_log(handle, ALPM_LOG_DEBUG, "sig path %s could not be opened\n",
+ sigpath);
+ handle->pm_errno = ALPM_ERR_SIG_MISSING;
+ goto error;
+ }
}
/* does the file we are verifying exist? */
@@ -441,17 +446,6 @@ int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path,
goto error;
}
- /* does the sig file exist (if we didn't get the data directly)? */
- if(!base64_sig) {
- sigfile = fopen(sigpath, "rb");
- if(sigfile == NULL) {
- _alpm_log(handle, ALPM_LOG_DEBUG, "sig path %s could not be opened\n",
- sigpath);
- handle->pm_errno = ALPM_ERR_SIG_MISSING;
- goto error;
- }
- }
-
if(init_gpgme(handle)) {
/* pm_errno was set in gpgme_init() */
goto error;