]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: rework how we reset the TTY after use by a service
authorLennart Poettering <lennart@poettering.net>
Wed, 20 Mar 2019 20:28:02 +0000 (21:28 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 20 Mar 2019 20:28:02 +0000 (21:28 +0100)
commit6f765baf23d0d4ed7efa6e2db2a629fd519f3a7a
tree791b17596710128935e3dff268b4c862396f1260
parent6c0ae739569038a0b65b756cae3248c889c22574
core: rework how we reset the TTY after use by a service

This makes two changes:

1. Instead of resetting the configured service TTY each time after a
   process exited, let's do so only when the service goes back to "dead"
   state. This should be preferable in case the started processes leave
   background child processes around that still reference the TTY.

2. chmod() and chown() the TTY at the same time. This should make it
   safe to run "systemd-run -p DynamicUser=1 -p StandardInput=tty -p
   TTYPath=/dev/tty8 /bin/bash" without leaving a TTY owned by a dynamic
   user around.
src/core/execute.c
src/core/execute.h
src/core/service.c