Systemd/src/coredump
Zbigniew Jędrzejewski-Szmek bc28751ed2 Rework cmdline printing to use unicode
The functions to retrieve and print process cmdlines were based on the
assumption that they contain printable ASCII, and everything else
should be filtered out. That assumption doesn't hold in today's world,
where people are free to use unicode everywhere.

This replaces the custom cmdline reading code with a more generic approach
using utf8_escape_non_printable_full().
For kernel threads, truncation is done on the parenthesized name, so we'll
get "[worker]", "[worker…]", …, "[w…]", "[…", "…" as we reduce the number of
available columns.

This implementation is most likely slower for very long cmdlines, but I don't
think this is very important. The common case is to have short commandlines,
and should print those properly. Absurdly long cmdlines are the exception,
which needs to be handled correctly and safely, but speed is not too important.

Fixes #12532.

v2:
- use size_t for the number of columns. This change propagates into various
  other functions that call get_process_cmdline(), increasing the size of the
  patch, but the changes are rather trivial.
2019-05-22 10:08:17 +02:00
..
coredump-vacuum.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
coredump-vacuum.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
coredump.c Rework cmdline printing to use unicode 2019-05-22 10:08:17 +02:00
coredump.conf build-sys: move coredump logic into subdir of its own 2016-02-10 14:32:27 +01:00
coredumpctl.c Merge pull request #12411 from keszybz/pr/12394 2019-05-08 10:11:32 -04:00
meson.build coredump: only install coredump.conf when ENABLED_COREDUMP=true 2018-11-02 14:31:12 +01:00
stacktrace.c Add open_memstream_unlocked() wrapper 2019-04-12 11:44:57 +02:00
stacktrace.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
test-coredump-vacuum.c Drop my copyright headers 2018-06-14 13:03:20 +02:00