]> git.ipfire.org Git - thirdparty/systemd.git/commit
journal: avoid infinite recursion when closing bad journal FD
authorLuca Boccassi <bluca@debian.org>
Fri, 16 Jun 2023 21:31:04 +0000 (22:31 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sun, 18 Jun 2023 11:31:53 +0000 (12:31 +0100)
commit40cdb3b756abbeb66091b8e9f1a3d38308456828
tree80e09eb85921443d660abc7401040b2dd9fc36ac
parent55e1ff26a59544bfd241582b41136a3761d566bb
journal: avoid infinite recursion when closing bad journal FD

When trying to log, if we fail we try to close the journal FD. If
it is bad, safe_close() will fail and assert, which will try to log,
which will fail, which will try to close the journal FD...
Infinite recursion looks very pretty live in gdb, but let's avoid
that by immediately invalidating the journal FD before closing it.
src/basic/log.c