crosvm/sys_util
Chirantan Ekbote 0060077114 syslog: closelog before trying to figure out the fd
The syslog subsystem tries to figure out the file descriptor for the
connection to the system logger so that it can ensure that it doesn't
get closed in each device process.

However, the check does not work properly if there was already an open
connection to the system logger.  In this case the openlog call does not
do anything and we end up guessing the wrong file descriptor number for
the syslog connection.

Work around this by adding a closelog() call before attempting all of
this cleverness.  In the long run this should be fixed properly by just
bind mounting /dev/log into each device process's jail.

BUG=none
TEST=Running crosvm under minijail0 does not cause an InvalidFd error.

Change-Id: Iffd535d62acdf8053817af74b9e97444c746a0cf
Signed-off-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/851271
Reviewed-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
2018-01-05 14:28:45 -08:00
..
src syslog: closelog before trying to figure out the fd 2018-01-05 14:28:45 -08:00
build.rs fix compiler errors and warnings 2017-08-30 13:04:16 -07:00
Cargo.toml fix dependency versions and add Cargo.lock 2017-09-20 03:39:24 -07:00
sock_ctrl_msg.c fix armv7a and aarch64 build errors and warnings 2017-09-01 12:39:18 -07:00