mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-18 14:17:03 +01:00
gpg: No need to create a trustdb when encrypting with --always-trust.
* g10/gpg.c (main): Special case setup_trustdb for --encrypt. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
ca6fe88c00
commit
498b9a95dc
27
g10/gpg.c
27
g10/gpg.c
@ -3440,7 +3440,8 @@ main (int argc, char **argv)
|
|||||||
ctrl = xcalloc (1, sizeof *ctrl);
|
ctrl = xcalloc (1, sizeof *ctrl);
|
||||||
gpg_init_default_ctrl (ctrl);
|
gpg_init_default_ctrl (ctrl);
|
||||||
|
|
||||||
switch( cmd ) {
|
switch (cmd)
|
||||||
|
{
|
||||||
case aPrimegen:
|
case aPrimegen:
|
||||||
case aPrintMD:
|
case aPrintMD:
|
||||||
case aPrintMDs:
|
case aPrintMDs:
|
||||||
@ -3449,12 +3450,24 @@ main (int argc, char **argv)
|
|||||||
case aEnArmor:
|
case aEnArmor:
|
||||||
break;
|
break;
|
||||||
case aFixTrustDB:
|
case aFixTrustDB:
|
||||||
case aExportOwnerTrust: rc = setup_trustdb( 0, trustdb_name ); break;
|
case aExportOwnerTrust:
|
||||||
case aListTrustDB: rc = setup_trustdb( argc? 1:0, trustdb_name ); break;
|
rc = setup_trustdb (0, trustdb_name);
|
||||||
default: rc = setup_trustdb(1, trustdb_name ); break;
|
break;
|
||||||
}
|
case aListTrustDB:
|
||||||
if( rc )
|
rc = setup_trustdb (argc? 1:0, trustdb_name);
|
||||||
log_error(_("failed to initialize the TrustDB: %s\n"), g10_errstr(rc));
|
break;
|
||||||
|
case aEncr:
|
||||||
|
case aEncrFiles:
|
||||||
|
/* If we are using TM_ALWAYS, we do not need to create the
|
||||||
|
trustdb. */
|
||||||
|
rc = setup_trustdb (opt.trust_model != TM_ALWAYS, trustdb_name);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
rc = setup_trustdb (1, trustdb_name );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (rc)
|
||||||
|
log_error (_("failed to initialize the TrustDB: %s\n"), g10_errstr(rc));
|
||||||
|
|
||||||
|
|
||||||
switch (cmd)
|
switch (cmd)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user