mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
Print verbose instructions in case of a corrupted trustdb.
This commit is contained in:
parent
12fa2baa62
commit
5d310a8de7
@ -1,3 +1,10 @@
|
|||||||
|
2009-07-22 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* gpg.c (main) <aFixTrustDB>: Show commands to run.
|
||||||
|
* trustdb.c (how_to_fix_the_trustdb): New.
|
||||||
|
* tdbio.c (tdbio_invalid): Show commands to re-create the trustdb.
|
||||||
|
Fixes bug#929.
|
||||||
|
|
||||||
2009-07-20 Werner Koch <wk@g10code.com>
|
2009-07-20 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* keygen.c (generate_keypair): Allow Elgamal > 3072 in BOTH mode.
|
* keygen.c (generate_keypair): Allow Elgamal > 3072 in BOTH mode.
|
||||||
|
@ -3372,8 +3372,8 @@ main (int argc, char **argv)
|
|||||||
case aGenRandom:
|
case aGenRandom:
|
||||||
case aDeArmor:
|
case aDeArmor:
|
||||||
case aEnArmor:
|
case aEnArmor:
|
||||||
case aFixTrustDB:
|
|
||||||
break;
|
break;
|
||||||
|
case aFixTrustDB:
|
||||||
case aExportOwnerTrust: rc = setup_trustdb( 0, trustdb_name ); break;
|
case aExportOwnerTrust: rc = setup_trustdb( 0, trustdb_name ); break;
|
||||||
case aListTrustDB: rc = setup_trustdb( argc? 1:0, trustdb_name ); break;
|
case aListTrustDB: rc = setup_trustdb( argc? 1:0, trustdb_name ); break;
|
||||||
default: rc = setup_trustdb(1, trustdb_name ); break;
|
default: rc = setup_trustdb(1, trustdb_name ); break;
|
||||||
@ -3895,9 +3895,7 @@ main (int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case aFixTrustDB:
|
case aFixTrustDB:
|
||||||
log_error("this command is not yet implemented.\n");
|
how_to_fix_the_trustdb ();
|
||||||
log_error("A workaround is to use \"--export-ownertrust\", remove\n");
|
|
||||||
log_error("the trustdb file and do an \"--import-ownertrust\".\n" );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case aListTrustPath:
|
case aListTrustPath:
|
||||||
|
@ -1499,12 +1499,11 @@ tdbio_search_trust_bypk (PKT_public_key *pk, TRUSTREC *rec)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
tdbio_invalid(void)
|
tdbio_invalid(void)
|
||||||
{
|
{
|
||||||
log_error(_(
|
log_error (_("Error: The trustdb is corrupted.\n"));
|
||||||
"the trustdb is corrupted; please run \"gpg --fix-trustdb\".\n") );
|
how_to_fix_the_trustdb ();
|
||||||
g10_exit(2);
|
g10_exit (2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,6 +111,7 @@ ulong tdbio_new_recnum(void);
|
|||||||
int tdbio_search_trust_byfpr(const byte *fingerprint, TRUSTREC *rec );
|
int tdbio_search_trust_byfpr(const byte *fingerprint, TRUSTREC *rec );
|
||||||
int tdbio_search_trust_bypk(PKT_public_key *pk, TRUSTREC *rec );
|
int tdbio_search_trust_bypk(PKT_public_key *pk, TRUSTREC *rec );
|
||||||
|
|
||||||
|
void tdbio_how_to_fix (void);
|
||||||
void tdbio_invalid(void);
|
void tdbio_invalid(void);
|
||||||
|
|
||||||
#endif /*G10_TDBIO_H*/
|
#endif /*G10_TDBIO_H*/
|
||||||
|
@ -407,6 +407,27 @@ setup_trustdb( int level, const char *dbname )
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
how_to_fix_the_trustdb ()
|
||||||
|
{
|
||||||
|
const char *name = trustdb_args.dbname;
|
||||||
|
|
||||||
|
if (!name)
|
||||||
|
name = "trustdb.gpg";
|
||||||
|
|
||||||
|
log_info (_("You may try to re-create the trustdb using the commands:\n"));
|
||||||
|
log_info (" cd %s\n", default_homedir ());
|
||||||
|
log_info (" gpg2 --export-ownertrust > otrust.tmp\n");
|
||||||
|
#ifdef HAVE_W32_SYSTEM
|
||||||
|
log_info (" del %s\n", name);
|
||||||
|
#else
|
||||||
|
log_info (" rm %s\n", name);
|
||||||
|
#endif
|
||||||
|
log_info (" gpg2 --import-ownertrust < otrust.tmp\n");
|
||||||
|
log_info (_("If that does not work, please consult the manual\n"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
init_trustdb()
|
init_trustdb()
|
||||||
{
|
{
|
||||||
|
@ -44,6 +44,7 @@ void register_trusted_key( const char *string );
|
|||||||
void check_trustdb (void);
|
void check_trustdb (void);
|
||||||
void update_trustdb (void);
|
void update_trustdb (void);
|
||||||
int setup_trustdb( int level, const char *dbname );
|
int setup_trustdb( int level, const char *dbname );
|
||||||
|
void how_to_fix_the_trustdb (void);
|
||||||
void init_trustdb( void );
|
void init_trustdb( void );
|
||||||
void check_trustdb_stale(void);
|
void check_trustdb_stale(void);
|
||||||
void sync_trustdb( void );
|
void sync_trustdb( void );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user