mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-02 21:11:05 +01:00
g10: Fix another race condition for trustdb access.
* g10/tdbio.c (create_version_record): Call create_hashtable to always make hashtable, together with the version record. (get_trusthashrec): Remove call to create_hashtable. -- GnuPG-bug-id: 1675 Thanks to Scott Moser to reproducible script and patience. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org> (backport from master commit 35a3ce2acf78a95fecbccfd8db0560cca24232df)
This commit is contained in:
parent
536c721183
commit
db246f8b18
@ -93,6 +93,7 @@ static int in_transaction;
|
||||
|
||||
static void open_db(void);
|
||||
static void migrate_from_v2 (void);
|
||||
static void create_hashtable (TRUSTREC *vr, int type);
|
||||
|
||||
static int
|
||||
take_write_lock (void)
|
||||
@ -469,6 +470,10 @@ create_version_record (void)
|
||||
rc = tdbio_write_record( &rec );
|
||||
if( !rc )
|
||||
tdbio_sync();
|
||||
|
||||
if (!rc)
|
||||
create_hashtable (&rec, 0);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -760,8 +765,6 @@ get_trusthashrec(void)
|
||||
if( rc )
|
||||
log_fatal( _("%s: error reading version record: %s\n"),
|
||||
db_name, g10_errstr(rc) );
|
||||
if( !vr.r.ver.trusthashtbl )
|
||||
create_hashtable( &vr, 0 );
|
||||
|
||||
trusthashtbl = vr.r.ver.trusthashtbl;
|
||||
}
|
||||
|
BIN
po/en@boldquot.gmo
Normal file
BIN
po/en@boldquot.gmo
Normal file
Binary file not shown.
BIN
po/en@quot.gmo
Normal file
BIN
po/en@quot.gmo
Normal file
Binary file not shown.
BIN
po/pt_BR.gmo
Normal file
BIN
po/pt_BR.gmo
Normal file
Binary file not shown.
6448
po/pt_BR.po~
Normal file
6448
po/pt_BR.po~
Normal file
File diff suppressed because it is too large
Load Diff
BIN
po/zh_CN.gmo
Normal file
BIN
po/zh_CN.gmo
Normal file
Binary file not shown.
5031
po/zh_CN.po~
Normal file
5031
po/zh_CN.po~
Normal file
File diff suppressed because it is too large
Load Diff
BIN
po/zh_TW.gmo
Normal file
BIN
po/zh_TW.gmo
Normal file
Binary file not shown.
5064
po/zh_TW.po~
Normal file
5064
po/zh_TW.po~
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user