crosvm/sys_util/src
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
..
errno.rs
eventfd.rs src_util: add poll module 2017-06-30 12:51:24 -07:00
fork.rs crosvm: add uid_map/gid_map support to jailed devices 2017-09-08 17:35:58 -07:00
guest_address.rs sys_util: Add guest_memory 2017-05-25 22:51:14 -07:00
guest_memory.rs sys_util: allow empty GuestMemory 2018-01-03 14:23:23 -08:00
handle_eintr.rs sys_util: move handle_eintr!() to sys_util so it can be reused 2017-06-30 12:51:24 -07:00
ioctl.rs sys_util: add ioctl module 2017-07-13 22:03:30 -07:00
lib.rs sys_util: add chown wrapper 2017-10-26 04:17:52 -07:00
mmap.rs sys_util: add mmap with offset support 2018-01-05 14:28:43 -08:00
passwd.rs sys_util: add get_user_id and get_group_id functions 2017-10-26 04:17:52 -07:00
poll.rs sys_util: add Pollable impls for UnixDatagram and UnixStream 2017-08-03 01:11:01 -07:00
shm.rs sys_util: add memfd seal support to SharedMemory 2018-01-05 14:28:44 -08:00
signal.rs sys_util: add signal module for killing threads 2017-06-30 12:51:24 -07:00
signalfd.rs sys_util: add signalfd module 2017-07-13 11:44:37 -07:00
sock_ctrl_msg.rs sys_util: allow sock_ctrl_msg to be more flexible with iovecs 2017-08-03 01:11:01 -07:00
struct_util.rs
syslog.rs syslog: closelog before trying to figure out the fd 2018-01-05 14:28:45 -08:00
tempdir.rs fix armv7a and aarch64 build errors and warnings 2017-09-01 12:39:18 -07:00
terminal.rs src_util: add terminal module 2017-06-30 12:51:24 -07:00