Fix: runas worker attempts to send invalid fd to master
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 6 Sep 2018 22:11:25 +0000 (18:11 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 7 Sep 2018 03:26:48 +0000 (23:26 -0400)
commit38069abf612962436357caec1c17e7f218f1a530
tree9a9a96bf7464d0bdbd2eaa14c143431be8146be3
parenteb95dccf3c2c9b41573fea62f4358493481071f7
Fix: runas worker attempts to send invalid fd to master

Commands which return a file descriptor (i.e. RUN_AS_OPEN) attempt
to send the resulting file descriptor even on failure. However,
this is not permitted by the UNIX socket interface.

As a result, skip the reception of the file descriptor payload
when a command fails. The 'master' end is also adapted to skip
the reception of the file descriptor in the case of an error.

A check has also been added to ensure that the 'master' end does
not attempt to send invalid file descriptors to the worker process.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/runas.c
This page took 0.025189 seconds and 4 git commands to generate.