process-util: allow rename_process() only in the main thread
authorLennart Poettering <lennart@poettering.net>
Sun, 24 Dec 2017 17:48:49 +0000 (18:48 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 25 Dec 2017 10:48:21 +0000 (11:48 +0100)
commit1096bb8a9e4a54bd9b2b1ce81533490d3ee9ecd0
tree7c76ec0e1a7f693dffdb93fd31fa13267377c0d2
parent18c528e99fb50c2d7d63b81ba5b91881db74f4c5
process-util: allow rename_process() only in the main thread

We make assumptions about the comm name we set via PR_SET_NAME: that it
would reflect the process name, but that's only the case for the main
thread. Moreover, we cache the mmap() region without locking.

Let's hence be safe rather than sorry and support all this only in the
main thread.
src/basic/process-util.c