From 79161ef7b9686b48ddbf95cb51c5e31564b40a1f Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 18 Jan 2005 09:51:58 +0000 Subject: [PATCH] (public_key_list): Do a trustdb staleness check before opening the keyring. (secret_key_list): Ditto. --- g10/ChangeLog | 6 ++++++ g10/keylist.c | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/g10/ChangeLog b/g10/ChangeLog index 385c338d4..bc37588c5 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,9 @@ +2005-01-18 Werner Koch + + * keylist.c (public_key_list): Do a trustdb staleness check before + opening the keyring. + (secret_key_list): Ditto. + 2005-01-10 David Shaw * keyedit.c (keyedit_menu): Move command strings outside the diff --git a/g10/keylist.c b/g10/keylist.c index feae6963a..b712aa466 100644 --- a/g10/keylist.c +++ b/g10/keylist.c @@ -95,6 +95,13 @@ public_key_list( STRLIST list ) printf("\n"); } + /* We need to do the stale check right here because it might need to + update the keyring while we already have the keyring open. This + is very bad for W32 because of a sharing violation. For real OSes + it might lead to false results if we are later listing a keyring + which is associated with the inode of a deleted file. */ + check_trustdb_stale (); + if( !list ) list_all(0); else @@ -104,6 +111,8 @@ public_key_list( STRLIST list ) void secret_key_list( STRLIST list ) { + check_trustdb_stale (); + if( !list ) list_all(1); else /* List by user id */