mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 05:55:19 +00:00
Fix iohelper usage with streams opened for read
bz #960879 Inb2878ed860
we added the O_NOCTTY flag when opening files in the stream code. Unfortunately a later piece of code was comparing the flags == O_RDONLY, without masking out the non-access mode flags. This broke the iohelper when used with streams for read, since it caused us to attach the stream output pipe to the stream input FD instead of output FD :-( Signed-off-by: Daniel P. Berrange <berrange@redhat.com> (cherry picked from commita2214c5257
)
This commit is contained in:
parent
ce902dcaf0
commit
a36dbe6475
@ -640,7 +640,7 @@ virFDStreamOpenFileInternal(virStreamPtr st,
|
||||
virCommandTransferFD(cmd, fd);
|
||||
virCommandAddArgFormat(cmd, "%d", fd);
|
||||
|
||||
if (oflags == O_RDONLY) {
|
||||
if ((oflags & O_ACCMODE) == O_RDONLY) {
|
||||
childfd = fds[1];
|
||||
fd = fds[0];
|
||||
virCommandSetOutputFD(cmd, &childfd);
|
||||
|
Loading…
Reference in New Issue
Block a user