]> git.ipfire.org Git - thirdparty/systemd.git/commit
coredump: restore compatibility with older patterns
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 29 Apr 2025 12:47:59 +0000 (14:47 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 28 May 2025 11:50:50 +0000 (12:50 +0100)
commitf9b8b75c11bba9b63096904be98cc529c304eb97
tree1dbbc8ef288bff04949ffaa84db51b009ddca98d
parentb4785653cbc0f9700f4fa3893863ff9a32075c44
coredump: restore compatibility with older patterns

This was broken in f45b8015513d38ee5f7cc361db9c5b88c9aae704. Unfortunately
the review does not talk about backward compatibility at all. There are
two places where it matters:
- During upgrades, the replacement of kernel.core_pattern is asynchronous.
  For example, during rpm upgrades, it would be updated a post-transaction
  file trigger. In other scenarios, the update might only happen after
  reboot. We have a potentially long window where the old pattern is in
  place. We need to capture coredumps during upgrades too.
- With --backtrace. The interface of --backtrace, in hindsight, is not
  great. But there are users of --backtrace which were written to use
  a specific set of arguments, and we can't just break compatiblity.
  One example is systemd-coredump-python, but there are also reports of
  users using --backtrace to generate coredump logs.

Thus, we require the original set of args, and will use the additional args if
found.

A test is added to verify that --backtrace works with and without the optional
args.

(cherry picked from commit ded0aac389e647d35bce7ec4a48e718d77c0435b)
src/coredump/coredump.c
test/units/TEST-87-AUX-UTILS-VM.coredump.sh