diff options
author | Simon McVittie <smcv@collabora.com> | 2021-01-12 10:45:14 +0000 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2021-06-22 17:57:35 +0100 |
commit | 8f72ceb2c42a2d93c858b8775a88f13b891c8120 (patch) | |
tree | 81c8ae935c6f1abca98607f806280ffb8b1d0f35 /utils.h | |
parent | 90c8cd49f7540cff4b29deb3b78903b855faa07d (diff) | |
download | bubblewrap-8f72ceb2c42a2d93c858b8775a88f13b891c8120.tar.gz |
Add --clearenv option
This allows environment variables to be set when running bwrap itself
(perhaps a custom LD_LIBRARY_PATH), but cleared for the command that
runs in the container, without having to enumerate all the variables.
Because PWD is set later, as a side-effect of changing directory, this
actually clears everything except PWD.
A portable program would check for clearenv() (and if not found, fall
back to using environ = NULL), but bubblewrap is Linux-specific, and
Linux C libraries (at least glibc and musl) do have clearenv().
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'utils.h')
-rw-r--r-- | utils.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -62,6 +62,7 @@ void *xrealloc (void *ptr, size_t size); char *xstrdup (const char *str); void strfreev (char **str_array); +void xclearenv (void); void xsetenv (const char *name, const char *value, int overwrite); |