diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2016-05-19 18:12:17 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2016-05-31 13:07:15 +0200 |
commit | 45e11be651dbd3855a35de4abd2922e5b9d4b963 (patch) | |
tree | a98a1fe79bd675a7bd4aaa824205a20ea9fd71f8 /m4 | |
parent | 518f5b83fd546e3188da01e4743ddb27a574e08f (diff) | |
download | sssd-45e11be651dbd3855a35de4abd2922e5b9d4b963.tar.gz sssd-45e11be651dbd3855a35de4abd2922e5b9d4b963.tar.xz sssd-45e11be651dbd3855a35de4abd2922e5b9d4b963.zip |
Do not leak fds in case of failures setting up a child process
Resolves:
https://fedorahosted.org/sssd/ticket/3006
The handling of open pipes in failure cases was suboptimal. Moreover,
the faulty logic was copied all over the place. This patch introduces
helper macros to:
- initialize the pipe endpoints to -1
- close an open pipe fd and set it to -1 afterwards
- close both ends unless already closed
These macros are used in the child handling code.
The patch also uses child_io_destructor in the p11_child code for safer
fd handling.
Reviewed-by: Petr Cech <pcech@redhat.com>
Diffstat (limited to 'm4')
0 files changed, 0 insertions, 0 deletions