diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-03-15 03:00:31 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-03-15 03:01:09 +0100 |
commit | 5e62067d08d989ab98b12497a9b27a877de8515b (patch) | |
tree | fa641dbbfb710145f82f2bc2874dfbd8a7fe706d | |
parent | c042179388f329fb1e45b00e1a533a0dc27fb9ae (diff) |
journald: adjust permissions for rotated files
-rw-r--r-- | src/journal/journald.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/journal/journald.c b/src/journal/journald.c index e5bcc26203..93cdec6c6c 100644 --- a/src/journal/journald.c +++ b/src/journal/journald.c @@ -334,20 +334,26 @@ static void server_rotate(Server *s) { r = journal_file_rotate(&s->runtime_journal); if (r < 0) log_error("Failed to rotate %s: %s", s->runtime_journal->path, strerror(-r)); + else + server_fix_perms(s, s->runtime_journal, 0); } if (s->system_journal) { r = journal_file_rotate(&s->system_journal); if (r < 0) log_error("Failed to rotate %s: %s", s->system_journal->path, strerror(-r)); + else + server_fix_perms(s, s->system_journal, 0); } HASHMAP_FOREACH_KEY(f, k, s->user_journals, i) { r = journal_file_rotate(&f); if (r < 0) log_error("Failed to rotate %s: %s", f->path, strerror(-r)); - else + else { hashmap_replace(s->user_journals, k, f); + server_fix_perms(s, s->system_journal, PTR_TO_UINT32(k)); + } } } |