chiark / gitweb /
journald: remove rotated file from hashmap when rotation fails
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 10 Oct 2013 02:13:13 +0000 (22:13 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 10 Oct 2013 02:32:08 +0000 (22:32 -0400)
commit2b98f75a63e6022bf74a7d678c47faa5208c794f
tree23998d5509123dbd26b567a932c9b64ba5fc876c
parent57535f4703b5de5d03ad6e35bd06247d378f46fe
journald: remove rotated file from hashmap when rotation fails

Before, when the user journal file was rotated, journal_file_rotate
could close the old file and fail to open the new file. In that
case, we would leave the old (deallocated) file in the hashmap.
On subsequent accesses, we could retrieve this stale entry, leading
to a segfault.

When journal_file_rotate fails with the file pointer set to 0,
old file is certainly gone, and cannot be used anymore.

https://bugzilla.redhat.com/show_bug.cgi?id=890463
src/journal/journald-server.c