util: always enforce O_NOCTTY and O_CLOEXEC in openpt_in_namespace()
authorLennart Poettering <lennart@poettering.net>
Wed, 7 Oct 2015 18:08:49 +0000 (20:08 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 7 Oct 2015 18:08:49 +0000 (20:08 +0200)
commit660021d371d5698a86e914765239045a669e65fb
treedde8b208436a55e327ac9cd1bf7ba984366f067f
parentc379f143a5ccdbc94a87cfca0174e7f21fa05f26
util: always enforce O_NOCTTY and O_CLOEXEC in openpt_in_namespace()

The child process is shortliving, hence always set O_NOCTTY so that the
tty doesn't quickly become controlling TTY and then gives it up again.
Also set O_CLOEXEC, because it's cleaner, and doesn't affect the parent
anyway.
src/basic/util.c