mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 15:10:48 +01:00
Merge branch 'bug23909'
This commit is contained in:
commit
92a42f795c
2 changed files with 8 additions and 4 deletions
4
changes/bug23909
Normal file
4
changes/bug23909
Normal file
|
@ -0,0 +1,4 @@
|
|||
o Minor features (directory authority):
|
||||
- Directory authorities now open their key-pinning files as O_SYNC,
|
||||
to prevent themselves from accidentally writing partial lines.
|
||||
Closes ticket 23909.
|
|
@ -289,8 +289,7 @@ static int keypin_journal_fd = -1;
|
|||
int
|
||||
keypin_open_journal(const char *fname)
|
||||
{
|
||||
/* O_SYNC ??*/
|
||||
int fd = tor_open_cloexec(fname, O_WRONLY|O_CREAT|O_BINARY, 0600);
|
||||
int fd = tor_open_cloexec(fname, O_WRONLY|O_CREAT|O_BINARY|O_SYNC, 0600);
|
||||
if (fd < 0)
|
||||
goto err;
|
||||
|
||||
|
@ -417,10 +416,11 @@ keypin_load_journal_impl(const char *data, size_t size)
|
|||
++n_entries;
|
||||
}
|
||||
|
||||
int severity = (n_corrupt_lines || n_duplicates) ? LOG_WARN : LOG_INFO;
|
||||
int severity = (n_corrupt_lines || n_duplicates) ? LOG_NOTICE : LOG_INFO;
|
||||
tor_log(severity, LD_DIRSERV,
|
||||
"Loaded %d entries from keypin journal. "
|
||||
"Found %d corrupt lines, %d duplicates, and %d conflicts.",
|
||||
"Found %d corrupt lines (ignored), %d duplicates (harmless), "
|
||||
"and %d conflicts (resolved in favor or more recent entry).",
|
||||
n_entries, n_corrupt_lines, n_duplicates, n_conflicts);
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue