chiark / gitweb /
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)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000 (16:47 +0200)
commitbbc6a6a0caba41c00c1dfd9a01c7129efaa5fe56
tree477456083f6758dc90bf7ef8daaf43c959392e82
parentae22dea58699350462ac7100283bec6919a60765
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