summaryrefslogtreecommitdiff
path: root/src/journal/journal-authenticate.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-08-17 01:19:32 +0200
committerLennart Poettering <lennart@poettering.net>2012-08-17 01:19:32 +0200
commite627440b41bb0284e4892f7aa9d84c77972487e2 (patch)
treea87f15688752981b7c35338370fdc8ca5a3cb8e3 /src/journal/journal-authenticate.c
parent31094aae09dd5a773e1634334bcd12fc8834a030 (diff)
journal: don't write tag objects if nothing has been written since the last time
Diffstat (limited to 'src/journal/journal-authenticate.c')
-rw-r--r--src/journal/journal-authenticate.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/journal/journal-authenticate.c b/src/journal/journal-authenticate.c
index ae64d3c8e0..9853edb58c 100644
--- a/src/journal/journal-authenticate.c
+++ b/src/journal/journal-authenticate.c
@@ -51,8 +51,6 @@ int journal_file_append_tag(JournalFile *f) {
if (!f->hmac_running)
return 0;
- log_debug("Writing tag for epoch %llu\n", (unsigned long long) FSPRG_GetEpoch(f->fsprg_state));
-
assert(f->hmac);
r = journal_file_append_object(f, OBJECT_TAG, sizeof(struct TagObject), &o, &p);
@@ -62,6 +60,10 @@ int journal_file_append_tag(JournalFile *f) {
o->tag.seqnum = htole64(journal_file_tag_seqnum(f));
o->tag.epoch = htole64(FSPRG_GetEpoch(f->fsprg_state));
+ log_debug("Writing tag %llu for epoch %llu\n",
+ (unsigned long long) le64toh(o->tag.seqnum),
+ (unsigned long long) FSPRG_GetEpoch(f->fsprg_state));
+
/* Add the tag object itself, so that we can protect its
* header. This will exclude the actual hash value in it */
r = journal_file_hmac_put_object(f, OBJECT_TAG, p);
@@ -221,10 +223,6 @@ int journal_file_maybe_append_tag(JournalFile *f, uint64_t realtime) {
if (r < 0)
return r;
- r = journal_file_hmac_start(f);
- if (r < 0)
- return r;
-
return 0;
}