mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 06:25:19 +00:00
Prevent streams from becoming libvirtd controlling TTY
When opening a stream to a device which is a TTY, that device may become the controlling TTY of libvirtd, if libvirtd was daemonized. This in turn means when the other end of the stream closes, libvirtd gets SIGHUP, causing it to reload its config. Prevent this by forcing O_NOCTTY on all streams that are opened Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
32bd699f55
commit
b2878ed860
@ -582,6 +582,8 @@ virFDStreamOpenFileInternal(virStreamPtr st,
|
||||
VIR_DEBUG("st=%p path=%s oflags=%x offset=%llu length=%llu mode=%o",
|
||||
st, path, oflags, offset, length, mode);
|
||||
|
||||
oflags |= O_NOCTTY;
|
||||
|
||||
if (oflags & O_CREAT)
|
||||
fd = open(path, oflags, mode);
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user