]> err.no Git - systemd/commitdiff
journald: adjust permissions for rotated files
authorLennart Poettering <lennart@poettering.net>
Thu, 15 Mar 2012 02:00:31 +0000 (03:00 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 15 Mar 2012 02:01:09 +0000 (03:01 +0100)
src/journal/journald.c

index e5bcc2620399a5a0922408667c7f9a7934521e37..93cdec6c6c6dacebdec54994c30c80012aea21cf 100644 (file)
@@ -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));
+                }
         }
 }