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 35a3ce2acf)
This commit is contained in:
Niibe Yutaka 2016-06-15 08:41:56 +09:00
parent 536c721183
commit db246f8b18
61 changed files with 165851 additions and 2 deletions

View File

@ -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/be.gmo Normal file

Binary file not shown.

4969
po/be.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/ca.gmo Normal file

Binary file not shown.

6486
po/ca.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/cs.gmo Normal file

Binary file not shown.

5204
po/cs.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/da.gmo Normal file

Binary file not shown.

5149
po/da.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/de.gmo Normal file

Binary file not shown.

7048
po/de.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/el.gmo Normal file

Binary file not shown.

6151
po/el.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/en@boldquot.gmo Normal file

Binary file not shown.

BIN
po/en@quot.gmo Normal file

Binary file not shown.

BIN
po/eo.gmo Normal file

Binary file not shown.

6313
po/eo.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/es.gmo Normal file

Binary file not shown.

6382
po/es.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/et.gmo Normal file

Binary file not shown.

6030
po/et.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/fi.gmo Normal file

Binary file not shown.

6130
po/fi.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/fr.gmo Normal file

Binary file not shown.

5292
po/fr.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/gl.gmo Normal file

Binary file not shown.

6462
po/gl.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/hu.gmo Normal file

Binary file not shown.

6110
po/hu.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/id.gmo Normal file

Binary file not shown.

6110
po/id.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/it.gmo Normal file

Binary file not shown.

5192
po/it.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/ja.gmo Normal file

Binary file not shown.

5002
po/ja.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/nb.gmo Normal file

Binary file not shown.

5002
po/nb.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/nl.gmo Normal file

Binary file not shown.

5380
po/nl.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/pl.gmo Normal file

Binary file not shown.

5136
po/pl.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/pt.gmo Normal file

Binary file not shown.

6105
po/pt.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/pt_BR.gmo Normal file

Binary file not shown.

6448
po/pt_BR.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/ro.gmo Normal file

Binary file not shown.

5890
po/ro.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/ru.gmo Normal file

Binary file not shown.

5195
po/ru.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/sk.gmo Normal file

Binary file not shown.

6114
po/sk.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/sv.gmo Normal file

Binary file not shown.

5298
po/sv.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/tr.gmo Normal file

Binary file not shown.

5934
po/tr.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/uk.gmo Normal file

Binary file not shown.

5219
po/uk.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/zh_CN.gmo Normal file

Binary file not shown.

5031
po/zh_CN.po~ Normal file

File diff suppressed because it is too large Load Diff

BIN
po/zh_TW.gmo Normal file

Binary file not shown.

5064
po/zh_TW.po~ Normal file

File diff suppressed because it is too large Load Diff