aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/context.h3
-rw-r--r--src/engine-gpg.c18
-rw-r--r--src/gpgme.c8
3 files changed, 29 insertions, 0 deletions
diff --git a/src/context.h b/src/context.h
index e976ba3f..7a1b9ada 100644
--- a/src/context.h
+++ b/src/context.h
@@ -134,6 +134,9 @@ struct gpgme_context
* after the operation. */
unsigned int ignore_mdc_error : 1;
+ /* True if the option --no-auto-check-trustdb shall be passed to gpg. */
+ unsigned int no_auto_check_trustdb : 1;
+
/* Pass --expert to gpg edit key. */
unsigned int extended_edit : 1;
diff --git a/src/engine-gpg.c b/src/engine-gpg.c
index 3bf5223c..9d20f2ba 100644
--- a/src/engine-gpg.c
+++ b/src/engine-gpg.c
@@ -150,6 +150,7 @@ struct engine_gpg
unsigned int ignore_mdc_error : 1;
unsigned int include_key_block : 1;
unsigned int auto_key_import : 1;
+ unsigned int no_auto_check_trustdb : 1;
} flags;
/* NULL or the data object fed to --override_session_key-fd. */
@@ -695,6 +696,8 @@ gpg_set_engine_flags (void *engine, const gpgme_ctx_t ctx)
if (ctx->include_key_block)
gpg->flags.include_key_block = 1;
}
+
+ gpg->flags.no_auto_check_trustdb = !!ctx->no_auto_check_trustdb;
}
@@ -934,6 +937,8 @@ build_argv (engine_gpg_t gpg, const char *pgmname)
argc++;
if (gpg->flags.offline)
argc++;
+ if (gpg->flags.no_auto_check_trustdb)
+ argc++;
if (gpg->pinentry_mode)
argc++;
if (!gpg->cmd.used)
@@ -1070,6 +1075,19 @@ build_argv (engine_gpg_t gpg, const char *pgmname)
argc++;
}
+ if (gpg->flags.no_auto_check_trustdb)
+ {
+ argv[argc] = strdup ("--no-auto-check-trustdb");
+ if (!argv[argc])
+ {
+ int saved_err = gpg_error_from_syserror ();
+ free (fd_data_map);
+ free_argv (argv);
+ return saved_err;
+ }
+ argc++;
+ }
+
if (gpg->pinentry_mode && have_gpg_version (gpg, "2.1.0"))
{
const char *s = NULL;
diff --git a/src/gpgme.c b/src/gpgme.c
index ed15912a..135a75a7 100644
--- a/src/gpgme.c
+++ b/src/gpgme.c
@@ -607,6 +607,10 @@ gpgme_set_ctx_flag (gpgme_ctx_t ctx, const char *name, const char *value)
if (!ctx->import_filter)
err = gpg_error_from_syserror ();
}
+ else if (!strcmp (name, "no-auto-check-trustdb"))
+ {
+ ctx->no_auto_check_trustdb = abool;
+ }
else
err = gpg_error (GPG_ERR_UNKNOWN_NAME);
@@ -688,6 +692,10 @@ gpgme_get_ctx_flag (gpgme_ctx_t ctx, const char *name)
{
return ctx->import_filter? ctx->import_filter : "";
}
+ else if (!strcmp (name, "no-auto-check-trustdb"))
+ {
+ return ctx->no_auto_check_trustdb? "1":"";
+ }
else
return NULL;
}