diff options
author | 2013-02-22 21:18:07 -0500 | |
---|---|---|
committer | 2013-02-24 23:15:44 -0500 | |
commit | e12fee192ac8b0343a468e5a8f7811a7b029ff9a (patch) | |
tree | 252b2e528a3fb99f5cc32127a32ad4d785008a6f /tests | |
parent | libsandbox: handle ENOSYS w/process_vm_readv (diff) | |
download | sandbox-e12fee192ac8b0343a468e5a8f7811a7b029ff9a.tar.gz sandbox-e12fee192ac8b0343a468e5a8f7811a7b029ff9a.tar.bz2 sandbox-e12fee192ac8b0343a468e5a8f7811a7b029ff9a.zip |
add a new message env var
This is used whenever sandbox wants to display an informational message.
For example, early notification of a path violation, or debugging output.
We can't just pop open an fd and pass that around as apps consider that
leakage and will often break assumptions in terms of free fds. Or apps
that start up and cleanse all of their open fds.
So instead, we just pass around an env var that holds the full path to
the file we want will write to. Since these messages are infrequent
(compared to overall runtime), opening/writing/closing the path every
time is fine.
This also avoids all the problems associated with using external portage
helpers for writing messages.
A follow up commit will take care of the situation where apps (such as
scons) attempt to also cleanse the env before forking.
URL: http://bugs.gentoo.org/278761
URL: http://bugs.gentoo.org/431638
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/sb_printf_tst.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/sb_printf_tst.c b/tests/sb_printf_tst.c index 867f782..1fe7566 100644 --- a/tests/sb_printf_tst.c +++ b/tests/sb_printf_tst.c @@ -11,6 +11,7 @@ int (*sbio_open)(const char *, int, mode_t) = (void *)open; FILE *(*sbio_popen)(const char *, const char *) = popen; const char sbio_fallback_path[] = "/dev/stderr"; +const char *sbio_message_path = sbio_fallback_path; int main(int argc, char *argv[]) { |