Add an extra log_fd argument to specify an FD to log to.
authorTony Young <tonyy@google.com>
Sun, 11 Jun 2017 22:06:13 +0000 (22:06 +0000)
committerTony Young <tony@rfw.name>
Sun, 11 Jun 2017 22:12:18 +0000 (22:12 +0000)
commitc55dc8cb12dbd2f12696266bbccf03b370a91bc8
tree68a76650e130972fcd4128efd41791b81b930d70
parenta55ff6386142316143a0bf079d7a2483476c785c
Add an extra log_fd argument to specify an FD to log to.

In some situations, setting --log to /proc/self/fd/# is not sufficient to log out to a different FD. For instance, if a master process passes its stderr to the child nsjail process as fd 3, the nsjail child may not always be able to log to /proc/self/fd/3, e.g. if the master process is running under systemd, whose /proc/self/fd/2 is actually a socket and not a pipe. However, having nsjail write to fd 3 directly is fine and there's no other good way to handle this situation.
cmdline.c
common.h
config.c
config.proto
log.c