process-util: also filter non-printable characters in get_process_com()
authorLennart Poettering <lennart@poettering.net>
Thu, 17 May 2018 01:50:35 +0000 (21:50 -0400)
committerLennart Poettering <lennart@poettering.net>
Fri, 1 Jun 2018 19:53:13 +0000 (21:53 +0200)
commitce268825539ebb94ed9755b9e78480abd863ece1
tree0c6fecc2cffac5a66feb0e2006df091c083a4f14
parent61f6e276714c0bc5c43f7f0c9daf1863f3958987
process-util: also filter non-printable characters in get_process_com()

We already do that in get_process_cmdline(), which is very similar in
behaviour otherwise. Hence, let's be safe and also filter them in
get_process_comm(). Let's try to retain as much information as we can
though and escape rather than suppress unprintable characters. Let's not
increase comm names beyond the kernel limit on such names however.

Also see discussion about this here:

https://marc.info/?l=linux-api&m=152649570404881&w=2
src/basic/process-util.c
src/test/test-process-util.c