Fix: double close of directory fd in runas worker
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 15 May 2019 15:37:55 +0000 (11:37 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 5 Sep 2019 20:39:13 +0000 (16:39 -0400)
commite1ddb036519b78242b349981054a41e765260e90
tree927f0116d5cf030f19e8ea89815a6fec15f28949
parent19facdca0f7dd7961e254adda733df011b03dc74
Fix: double close of directory fd in runas worker

The run-as worker implements its mkdirat and mkdirat_recursive commands
on top of the lttng_directory_handle interface. When a directory
handle is created from a directory file descriptor, it assumes the
ownership of this file descriptor and it will release it when
lttng_directory_handle_fini() is invoked.

The runas worker's post-command clean-up closes any file descriptor
received from its client. The command structure's `fd` is set to
`-1` in order to make the received file descriptor invalid and
prevent the double-close.

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