mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-24 18:56:59 +07:00
journalctl: immeidately terminate on invalid seed
This commit is contained in:
parent
b7c9ae91d1
commit
56e81f7ca8
@ -667,7 +667,7 @@ int journal_file_verify(JournalFile *f, const char *seed) {
|
||||
r = journal_file_parse_seed(f, seed);
|
||||
if (r < 0) {
|
||||
log_error("Failed to parse seed.");
|
||||
goto fail;
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -601,13 +601,18 @@ static int verify(sd_journal *j) {
|
||||
HASHMAP_FOREACH(f, j->files, i) {
|
||||
int k;
|
||||
|
||||
#ifdef HAVE_GCRYPT
|
||||
if (!arg_verify_seed && journal_file_fsprg_enabled(f))
|
||||
log_warning("Journal file %s has authentication enabled but verification seed has not been passed using --verify-seed=.", f->path);
|
||||
#endif
|
||||
|
||||
k = journal_file_verify(f, arg_verify_seed);
|
||||
if (k < 0) {
|
||||
if (k == -EINVAL) {
|
||||
/* If the seed was invalid give up right-away. */
|
||||
return k;
|
||||
} else if (k < 0) {
|
||||
log_warning("FAIL: %s (%s)", f->path, strerror(-k));
|
||||
r = -r;
|
||||
r = k;
|
||||
} else
|
||||
log_info("PASS: %s", f->path);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user