summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/signing.c
diff options
context:
space:
mode:
authorOlivier Brunel <jjk@jjacky.com>2014-06-15 19:42:40 +0200
committerAllan McRae <allan@archlinux.org>2014-06-24 05:52:15 +0200
commitf1fadecfb34555cfac1c47f217253a535d64a28b (patch)
tree4221201d464af1d0ca234ef05cfd629c00a466e8 /lib/libalpm/signing.c
parentd06d993d56bda499be31042bd39aaea9b8b11e3d (diff)
downloadpacman-f1fadecfb34555cfac1c47f217253a535d64a28b.tar.gz
pacman-f1fadecfb34555cfac1c47f217253a535d64a28b.tar.xz
Update the question callback
Much like with events, instead of using a bunch of void* arguments for all questions, we now send one pointer to an alpm_question_t union. This contains the type of question that was triggered. With this information, a question-specific struct can be accessed in order to get additional arguments. Signed-off-by: Olivier Brunel <jjk@jjacky.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/signing.c')
-rw-r--r--lib/libalpm/signing.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
index 8fb909d9..c6b748e3 100644
--- a/lib/libalpm/signing.c
+++ b/lib/libalpm/signing.c
@@ -417,7 +417,7 @@ gpg_error:
*/
int _alpm_key_import(alpm_handle_t *handle, const char *fpr)
{
- int answer = 0, ret = -1;
+ int ret = -1;
alpm_pgpkey_t fetch_key;
memset(&fetch_key, 0, sizeof(fetch_key));
@@ -425,9 +425,13 @@ int _alpm_key_import(alpm_handle_t *handle, const char *fpr)
_alpm_log(handle, ALPM_LOG_DEBUG,
"unknown key, found %s on keyserver\n", fetch_key.uid);
if(!_alpm_access(handle, handle->gpgdir, "pubring.gpg", W_OK)) {
- QUESTION(handle, ALPM_QUESTION_IMPORT_KEY,
- &fetch_key, NULL, NULL, &answer);
- if(answer) {
+ alpm_question_import_key_t question = {
+ .type = ALPM_QUESTION_IMPORT_KEY,
+ .import = 0,
+ .key = &fetch_key
+ };
+ QUESTION(handle, &question);
+ if(question.import) {
if(key_import(handle, &fetch_key) == 0) {
ret = 0;
} else {